Pro Java 9 Games Development Leveraging the JavaFX APIs

(Michael S) #1

Chapter 23 ■ Completing the gameplay Code and player proofing your event handling


Figure 23-35. Use Run ➤ Project and test the final error-proofing code and Play Again User Interface


Congratulations, the basic gameplay has now been completed, and we can look at optimization and
profiling.


Summary


In this twenty-third chapter, we learned how to create the player-proofing logic to enforce proper usage
of the i3D spinner UI, the game board squares, and the Answer Button UI elements. This involved using
about a half-dozen boolean variables, which were used as “flags,” to turn off the ability of the player to click
a UI element more than one time per round of gameplay. We protected the i3D spinner UI, the Button UI
answers, and each quadrant’s game board squares from being “misused” to game the system and run up
unearned points. This is an important part of pro Java 9 game design and development to make sure that
your gameplay logic is played in the manner in which it was intended to be played.
We also finished adding the rest of the gameplay content during the first part of the chapter, adding
nearly 600 lines of Java code and taking the current pro Java 9 game development project to nearly 1,750
lines of Java code.
In Chapter 24 , you’re going to finish up by looking at game optimization, evaluation using NetBeans 9,
and the NetBeans 9 Profiler.

Free download pdf