(Renkum, Saturday 23rd of August 2012)

Displaying the score

With the nice gradient in mind, I was curious if it would be easy to replace the red, green and blue blocks by little pictures. So today I added some png files.

I added a heart, a star and an arrow

var imageHeart = new Image();
var imageStar = new Image();
var imageArrow = new Image();
imageHeart.src = "heart64.png";
imageStar.src = "star64.png";
imageArrow.src = "arrow64.png";

Now we only need to add them to the game. I used the canvas drawImage to do that.

function drawImage(x,y, image){
	ctx.drawImage(image, x*itemWidth,(fieldHeight-y-1)*itemHeight,itemWidth, itemHeight); 
}

Now just replace the draw methods and there's the new look of the game.

It took me 3 hours (of which 2 using ms-paint and gimp for 3 little 64x64 pictures), to make the application look more professional.

To check the result, click here.

 


Day1 Day2 Day3 Day4 Day5 Day6 Day7
back to index