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 live online training, plus books, videos, and digital content from nearly 200 publishers.