Computer games typically have multiple levels where the difficulty of playing the game progressively increases. This is what makes a game fun, challenging, and even somewhat addictive. We want to incorporate levels in our game as well.
One simple way to make the game play harder and harder is to increase the speed of the ball as the player continues to score points. You can create whatever tiers you like, but for the purpose of this tutorial, we will create a simple tier system: whenever a player scores 5 points, the player has completed a level. Again, to keep it simple, we will not pause game play (as is common in most computer games) when a level is completed. The player will automatically move on to the next level, which will also increase the speed of the ball.
To figure out whether a level change is needed or not, we will code the app to constantly check the value of score. Each time the score is incremented, the app will check to see whether it is a multiple of 5 (for...