+ 1
Why orange blocks don't have constantly speed?
Hello guys, in my next game project -> https://code.sololearn.com/Wxann6l3d3tJ/#html orange blocks don't have constantly speed, they don't move smoothly. But why? Thank you and have nice day!
3 Answers
+ 1
Hi Yuri Biasi!
As you're requesting an animation frame for the_game function, the_game will be called repeatedly. And, every call will set a new interval for timer function because of:
setInterval ( timer, 1000 ); // 88th line
To solve this, move your 88th line out of the the_game function and place it in 84th line.
+ 2
Yuri Biasi, welcome :)
+ 1
Thank you very very much! :)