Starting the Pong game

If you don't know what Pong is then you are much younger than me and you should take a look at its appearance and history before continuing. We will use everything we learned about OOP to create a class for each of the objects of the game (a bat and a ball) as well as methods within these classes to make our bat and ball behave as we expect.

The game will have a controllable bat at the bottom of the screen and a ball that starts at the top and bounces around off of all four "walls". When the ball hits the bottom the player loses a life and when the ball hits the bat the player gets a point. The player will start with 3 lives.

Planning the Pong game

In the last project we laid out all the method declarations and most of the ...

Get Learning Java by Building Android Games - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.