28.04.2019 Views

[JAVA][Beginning Java 8 Games Development]

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 6 ■ The Foundation of Game Design: The <strong>Java</strong>FX Scene Graph and the InvinciBagel Game Infrastructure<br />

Figure 6-13. Profiling the Scene Graph UI design thus far to make sure that it does not use any perceptible CPU cycles<br />

As you can see in the Total Time column, on the right-hand side of the figure, the createSplashScreenNodes()<br />

method takes 279 milliseconds, or approximately three-tenths of a second, to execute, and your Scene Graph is<br />

created. The addNodesToStackPane() method takes approximately 3 milliseconds, or three one-thousandths of a<br />

second, to execute.<br />

If you look at the threads profiling output and click the UI button elements, you will see a blip of color appear<br />

on the thread, showing the processing overhead of a button click, which, as you can see, is less than one-tenth of a<br />

second per click (look at the Invocations column, on the far right, to see how many times I tested the button click<br />

functions). I highlighted the threads view, where I clicked High Scores, and then the Legal and Credits button UI<br />

elements (see Figure 6-14). As you can see in this view as well, the current design is using minimal resources.<br />

www.it-ebooks.info<br />

143

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

Saved successfully!

Ooh no, something went wrong!