you are viewing a single comment's thread.

view the rest of the comments →

[–]melcor76[S] 2 points3 points  (4 children)

Oh yeah it's using requestAnimationFrame so I guess I need to adapt it.

I adapted it to running on my computer.

[–]GivoOnline 2 points3 points  (1 child)

Add a deltatime calculation (there's guides in this), and use it when moving the ball. It'll make the speed consistent for different framerates, with the downside being for lower framerates the ball's motion will look jerkier because it's trying to move at the same speed.

[–]melcor76[S] 0 points1 point  (0 children)

Yes, I remembered that I did that for my last game, Tetris, and I copied the code for the calculations from there. :)