Game Development Reference
In-Depth Information
spriteFrame.setTranslateX( spriteMoveL );
} else {
onScreen = false ;
takeSides = false ;
callAttack = false ;
}
}
Figure 17-38 . Add an if(onScreen) level of processing inside the if(takeSides) logic to animate a sprite from the left
side
Weaponizing the Enemy: Shooting Pro-
jectile Objects
Now that we have the Enemy animating onto (and off of) both sides of the screen, the
next level of complexity that we need to add is the shooting of Projectile objects. We'll
first implement iBullet objects (negative score generation) and later iCheese objects
(positive score generation), both of which will require our Enemy.java class to have
 
Search WWH ::




Custom Search