The game randomly speeds up and down because it's running as fast as possible, since you don't limit the speed nor keep track of time since last update.
There are several approaches you can take when it comes to dealing with this. Of course it would be simplest to just limit game to 60FPS, but if you want, here you can learn more about game loops and make it better.
The game randomly speeds up and down because it's running as fast as possible, since you don't limit the speed nor keep track of time since last update. There are several approaches you can take when it comes to dealing with this. Of course it would be simplest to just limit game to 60FPS, but if you want, here you can learn more about game loops and make it better.
Pretty good job so far!