- Learning Java by Building Android Games
- John Horton
- 132字
- 2021-07-23 19:02:34
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.