Game Development Reference
In-Depth Information
Using this in GamePlayLoop() Constructor:
GamePlayLoop(this)
Open up your .createStartGameLoop() method structure, using the + expand icon on
the left side of NetBeans, as shown in Figure 12-9 . Add the Java this keyword in the
parameter area, so that you are again passing the InvinciBagel object reference, this
time into the GamePlayLoop() constructor method call. This will give that class a ref-
erence to your InvinciBagel class and its context and structure, just like you did with
the Bagel class. Your newly revised Java method body and constructor method call will
look like the following code, which is shown highlighted in Figure 12-9 :
private void createStartGameLoop() {
gamePlayLoop = new GamePlayLoop( this );
gamePlayLoop.start();
}
Figure 12-9 . Add a Java this keyword inside of the GamePlayLoop() constructor method call to provide a context
object
 
 
Search WWH ::




Custom Search