Creating the variables required

Here are the new variables that we will declare:

private ArrayList<UpperBoundary> upperBoundary;private ArrayList<LowerBoundary> lowerBoundary;private int maxBoundaryHeight;private int minBoundaryHeight;private boolean upBound = true;private boolean lowBound = true;private int progressDenom = 20;private boolean newGameCreated;

We create our upperBoundary and lowerBoundary variables as ArrayList to keep a track of our actual game object on the screen, then we also create two integer variables--maxBoundaryHeight and minBoundaryHeight--to keep a track of the maximum and minimum heights for our upper boundary. We also create two Boolean variables--upBound and lowBound--if our boundaries go out of our specified ...

Get Learning Android Game Development 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.