Activity 1 - Define the width of the Pong screen

You can adjust the boundary of the Pong game by adjusting the height and width of the rectangle that represents the boundary.

Go to the code containing the Pong game. Press run. Notice that the game’s boundary doesn’t seem look right - see the image below. Let’s fix that in this activity, so that the game boundary looks better.

Pong game with incorrect boundary

Find # TODO (ACTIVITY 1) in the code. Follow the instructions there to modify the WIDTH attribute of the Pong class. If you did this correctly, the boundary problem will be fixed. Press run to observe the result.

Try changing the values for height and width to see the effects of different values on the game’s boundary.

Launch Replit


You have just modified one of the attributes in the Pong class to influence how the game will look on-screen.