public void killShell() { //this is what happens when a shell explodes if(shell != null) { blasts[1] = new Blast(this,shell.x-40,shell.y-40,80,35); shell = null; creatorGame.myGameScreen.drawFrame(); creatorGame.myGameScreen.resetExplotionLayer(); } }
public void fireBomb() { //this is called to fire a bomb ratio = aim/5; // This works out the ratio between y velosity and x velosity from the angle aim if(ratio <= 18 && ratio != 0) { shellYVel = (18 - ratio); shellXVel = (ratio); } else if(ratio >18 && ratio <= 36) { ratio -= 18; shellYVel = -(ratio); shellXVel = (18 - ratio ); } else if(ratio >36 && ratio <= 54) { ratio -= 36; shellYVel = -(18 - ratio); shellXVel = -(ratio ); } else if(ratio >54 && ratio <= 72) { ratio -= 54; shellYVel = (ratio); shellXVel = -(18 - ratio); } this.damage = creator.bombDamage; firing = true; shell = new Projectile(this,x,y-10, Convert.ToInt32(Convert.ToSingle(shellXVel) * power), Convert.ToInt32(Convert.ToSingle(shellYVel) * power)); stopTurn(); }