O'Reilly logo

Beginning Java 8 Games Development by Wallace Jackson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 17

image

Enhancing Game Play: Creating a Scoring Engine, Adding Treasure and an Enemy Auto-Attack Engine

Now that we’ve implemented collision detection for our game, as well as putting the foundation in place for a scoring engine, let’s finish coding the scoring engine that is called from the .checkCollisions() method, and then add some more game play elements to take advantage of this scoring engine, as well as to make the game play more interesting. To implement our scoring engine display, we will create a gameScore integer variable and scoreText Text object in our InvinciBagel.java class. We will also create a scoreFont Font object, and use ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required