Game Development Reference
In-Depth Information
Figure 17-52 . Modify X and Y parameters for all Enemy and Projectile constructor methods, to place them off-screen
You also may have noticed that the Projectile objects are on top of the Enemy's ba-
zooka, so let's change the z-index of the iBeagle object, so the projectiles come from
behind the gun. To do this, put your .add() method call for the iBeagle after iBullet, and
before iBagel, at the end of the .addGameActorNodes() method, as seen in Figure
17-53 .
Figure 17-53 . Change z-index of iCheese and iBullet in the addGameActorNodes() method so they're before iBeagle
Now let's add even more realism to this auto-attack game play, by randomizing
which side the Enemy sprite emerges from, so that the game player does not know
 
 
 
Search WWH ::




Custom Search