public static void HandleCollision(Fireball fireball, IPipe pipe, Game1.Side side) { if (side == Game1.Side.Top) { fireball.Bounce(); } else if (side != Game1.Side.None) { fireball.ChangeState(); } }
public static void HandleCollision(Fireball fireball, IEnemy enemy, Game1.Side side) { EnemyGravityHandler gravity = new EnemyGravityHandler(); if (side != Game1.Side.None) { if (enemy is Goomba) { Goomba localGoomba = (Goomba)enemy; localGoomba.BeFlipped(); gravity.ApplyGravityToEnemy(localGoomba); } if (enemy is Koopa) { Koopa localKoopa = (Koopa)enemy; localKoopa.BeFlipped(); gravity.ApplyGravityToEnemy(localKoopa); } fireball.ChangeState(); } }
public void ThrowFireball() { Fireball fireball = new Fireball(this.mario.location, 1); WorldManager.spriteSet.projectiles.Add(fireball); }