Building a simple game of Pong
Create a new project called Pong, and leave all the settings at their defaults.
Adding sound files to the project
Using your operating system's file browser, go to the app/src/main folder of the project and add a new folder called assets.
There are four sound files already made for you in the Chapter 28/Pong/assets folder of the download bundle. Place these four files into the assets directory you just created, or you can use some sound effects you create yourself. The important thing is that their filenames must be beep1.ogg, beep2.ogg, beep3.ogg, and loseLife.ogg.
Coding the ball
Create a new class called Ball. Unsurprisingly, this class will handle everything to do with the ball in the game. We will code it in eight short segments.
First, add the following member variables. The only one that is completely new is the RectF object. This is simply an object that holds four float values that define the four coordinates of a rectangle. This is perfect for a ball...