Maximum and minimum boundary heights

In our update() method, we will assign these values based on the player score and progressDenom. We will also use this method to call our updateUpperBound() and updateLowerBound() methods that we created earlier in this chapter:

this.updateUpperBound();this.updateLowerBound();maxBoundaryHeight = 30+playerCharacter.getScore() / progressDenom;if(maxBoundaryHeight > HEIGHT/4)maxBoundaryHeight = HEIGHT/4;minBoundaryHeight = 5 + playerCharacter.getScore()/progressDenom;

We're almost there. Now, the only thing remaining to create is our newGame() function.

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.