Code skill Making the ball bounce

We want to make our game a challenge for the player. At the moment the ball just bounces backwards and forwards in a straight line which is very predictable. First we need to add code that will keep track of the ball’s speed. Then we can change the speed at which it moves from left to right and up and down on the board. We also need to make sure the ball doesn’t speed up too much. Don’t worry if your game isn’t any different. We will call the new functions in the next step.

See the Pen GB6 M3 by Walker Books UK (@walkerbooks) on CodePen.