Game Development Reference
In-Depth Information
double yLocation, Image... spriteCels) {
super(SVGdata, xLocation, yLocation, spriteCels);
spriteFrame.setTranslateX(xLocation);
spriteFrame.setTranslateY(yLocation);
isFixed = false;
isBonus = true;
hasValu = true;
}
@Override
public void update () {
// Empty Method
}
}
Figure 17-20 . Create a Projectile.java class, override the .update() method, and code a Projectile() constructor meth-
od
Adding an Enemy and Projectiles to the Game: Invin-
ciBagel.java
Open the InvinciBagel.java tab in NetBeans and declare an Enemy object, named
iBeagle , and two Projectile objects, named iBullet and iCheese , underneath the iBagel
Bagel object, as shown highlighted in Figure 17-21 . Next, declare three Image objects,
 
 
Search WWH ::




Custom Search