As we are quite familiar with the process of creating a new class, we will simply create our two new classes for our upper and lower boundary and call them UpperBoundary.java and LowerBoundary.java, respectively. We have the following objectives for our boundaries:
- Make them appear at the top and bottom of our game screen
- If a player collides with them, then reset the game
With these objectives in mind, we will move ahead to create boundaries for our game.