28.04.2019 Views

[JAVA][Beginning Java 8 Games Development]

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 7 ■ The Foundation of Game Play Loop: The <strong>Java</strong>FX Pulse System and the Game Processing Architecture<br />

Figure 7-20. Create an if-else loop that moves the HBox UI counterclockwise around the four corners of a splash screen<br />

As the figure illustrates, your code is error free, and you are ready to use the Run ➤ Project work process and<br />

watch the 60FPS fireworks! Get ready for some blinding speed!<br />

Next, let’s run the Live Results Profiler and Threads Profiler one last time to see if your pulse engine is cranking!<br />

Once you do this, you will know that you have successfully implemented your GamePlayLoop timing engine for your<br />

game, and you can then shift your focus to developing your game sprites, collision detection, physics, and logic!<br />

Profiling the GamePlayLoop: Pulse Engine<br />

Now, let’s use the Profile ➤ Profile Project (InvinciBagel) work process one final time to see if anything new has<br />

appeared in the Live Results and Threads tabs in NetBeans. Click the Live Results icon, shown at the left of Figure 7-21,<br />

and start the Live Results Profiler in a tab. Note that the GamePlayLoop object is created, using ; that an<br />

AnimationTimer is started, using the invincibagel.GamePlayLoop.start() entry in the Profiler output; and that there<br />

is an invincibagel.GamePlayLoop.handle(long) entry as well, which means that your game timing loop is being<br />

processed.<br />

www.it-ebooks.info<br />

161

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!