Pro Java 9 Games Development Leveraging the JavaFX APIs

(Michael S) #1

Chapter 24 ■ Optimizing game assets and COde, and game prOfiling Using netBeans


Resetting the game using the Let’s Play Again Button object and all of its processing uses as much
overhead as a 3D board spin (Figure 24-19) does, as shown in Figure 24-22. Garbage collection resets all
the texture maps, the camera animation changes gameplay perspective, then event handling locks down
unwanted clicking, the audio playback plays a camera animation audio effect, and similar processing-
intensive code resets the gameplay for another round.


Figure 24-21. Picking an answer (Button) involves the least amount of overhead and just minor CPU
overhead for scoring


Figure 24-22. Clicking a Let’s Play Again Button object invokes a second flurry of CPU and memory use for
special effects such as audio and animation

Free download pdf