Game Development Reference
In-Depth Information
Figure 17-60 . Adding physics simulation of gravity to the Projectile object's trajectory in the .shootProjectile() meth-
od
Summary
In this seventeenth and final chapter, we used all of the foundational elements of our
game engine(s) that we have been building during the course of this topic, and created
the basic game play for the InvinciBagel game, including a scoring engine and an auto-
attack engine, as well as random attack strategies and basic physics simulation to en-
hance realism. We learned how to use the JavaFX 8.0 Text and Font class to create
scoreboard output on the game, and how to use the Java 8 Random class as a random
number generator to make our auto-attack engine seem like it had a life of its own. We
also added bounty to the game by coding a Treasure.java class and created a .scorin-
gEngine() method to track and organize our scoring algorithm. We learned more about
optimization, using if-else-if loops with break; and learned how to use return; to
 
Search WWH ::




Custom Search