I’m just started on playing around with the canvas HTML5-object. For the sake of performance tests, I have made a little ping pong game.
Are there any performance improvements I could use?
The ball seems to be blue with a touch of red, but my declaration it should be yellow. How can I fix this?
This should help you with the ball color;
fill() doesn’t apply to fillRect(), the latter is drawing a filled rectagle and fill() is to fill pathes.
There’s not much you can improve with an simple pong game, but i’ll give some general advices for canvas performance:
As said, very general advices and might not be appropriate for every case.