Game Development Reference
In-Depth Information
od call at the end of the methods that are called inside of the .update() method. This
method will call collision detection Java code, which we are about to put into place
during the remainder of this chapter, on every pulse event that is processed. This is in
keeping with the logical sequence of game code processing inside of the .update()
method.
The new .update() method, which is seen in Figure 16-30 , should look like the fol-
lowing Java method body:
public void update () {
setXYLocation();
setBoundaries();
setImageState();
moveInvinciBagel();
// playAudioClip();
checkCollision();
}
Figure 16-30 . Comment out the playAudioClip() method call to turn off all audio and add a checkCollision() method
call
Create an empty public void checkCollision(){} method body, which
will remove that wavy red error highlighting that you see in Figure 16-30 , so that we
can begin to put the code into place that will look through the CURRENT_CAST
 
 
Search WWH ::




Custom Search