I'm writing an HTML5 Javascript game that uses the <canvas>
tag, and and I'm not sure which is better for a sprite: a <canvas>
tag or an Image(). A friend says <canvas>
, so that we can play with its colors, make it blink, etc, but I think an Image() will be faster.
I'd like some input on this, since I'm quite clueless.
Actual examples:
I have a little car I want to draw on the screen. Let's say it's a racing game and I want the keyboard to move the car. Should the car be an Image() or a <canvas>
.
I have a background landscape to put on the back of my 2D Platformer. Image() or <canvas>
?