Game Development Reference
In-Depth Information
Figure 7-10 . At the end of the .start() method, instantiate the gamePlayLoop object by using the Java new keyword
The logic of this code placement (at the end), is to set up all your static objects, in
terms of creation and configuration, and then create the dynamic object at the end that
will be processing the pulse-related logic.
Profiling the GamePlayLoop Object:
Running NetBeans Profiler
Let's run NetBeans Profiler, using a Profile Project Profile menu sequence, to de-
termine if you can see the GamePlayLoop object that you have created in any of the
profiling views. As Figure 7-11 demonstrates, the GamePlayLoop <init> call takes less
than 2 milliseconds to set up the GamePlayLoop object in memory for your use, using
very little overhead.
 
 
Search WWH ::




Custom Search