Game Development Reference
In-Depth Information
invinciBagel. iBullet .spriteFrame.setTranslateX(bulletOffset);
} else { shootBullet = false; }
}
if( !bulletType && takeSides ) {
invinciBagel. iBullet .spriteFrame.setTranslateY(randomOffset);
invinciBagel. iBullet .spriteFrame.setScaleX(0.5);
invinciBagel. iBullet .spriteFrame.setScaleY(0.5);
bulletRange = 624;
if(bulletOffset <= bulletRange) {
bulletOffset+=4;
invinciBagel. iBullet .spriteFrame.setTranslateX(bulletOffset);
} else { shootBullet = false; }
}
Figure 17-51 . Add bulletType to conditional if statement evaluation in shootProjectile() method, to shoot cream
cheese
Next we need to do the same conversion for the bulletType equals true value. This
will signify use of Cream Cheese as a Projectile object type. Once we put these condi-
tional if() structures into place, we'll have one if() structure for each logical combina-
 
Search WWH ::




Custom Search