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

  • Wallace Jackson
Chapter

Abstract

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 it to style the scoreText Text object, to make it stand out better. We will also learn how to use the Java instanceof evaluator in the conditional if() statement in the .scoringEngine() method that we will be creating, and use this to determine what type of Actor object the InvinciBagel has collided with. Of course, we will then increment our gameScore variable accordingly.

Keywords

Programming Logic Game Play Method Call Actor Object Constructor Method 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Copyright information

© Wallace Jackson 2014

Authors and Affiliations

  • Wallace Jackson
    • 1
  1. 1.CAUnited States

Personalised recommendations