Exemplo n.º 1
0
        private void FireProjectile(Point target)
        {
            WeaponProjectile projectile = Magazine.Dequeue();

            Game.AddGameObject(projectile);
            if (ProjectilesLeftAnimation != null)
            {
                ProjectilesLeftAnimation.Start();
            }
        }
Exemplo n.º 2
0
 public override void Damage(int damage, WeaponProjectile damageSource)
 {
     HitPoints -= damage;
     if (HitPoints > 0)
     {
         AnimateDamage();
     }
     else
     {
         if (animatingDamage)
         {
             CancelDamageAnimation();
         }
         ExplosionAnimator.StartExplosion(Game, this, damageSource);
         Game.PlayerCash += CashForKilling;
         Destroy();
     }
 }
Exemplo n.º 3
0
 public abstract void Damage(int damage, WeaponProjectile damageSource);
Exemplo n.º 4
0
        private static Explosion GetExplosionType(GameController game, MovableGameObject target, WeaponProjectile explosionSource)
        {
            Explosion explosionAnimation = null;
            Type      projectileType     = explosionSource.GetType();

            if (projectileType == typeof(TankMachineGunBullet))
            {
                explosionAnimation = new MediumExplosion(game, target);
            }
            else if (projectileType == typeof(TankMissileLauncherMissile))
            {
                explosionAnimation = new BigExplosion(game, target);
            }
            return(explosionAnimation);
        }
Exemplo n.º 5
0
        public static void StartExplosion(GameController game, MovableGameObject target, WeaponProjectile explosionSource)
        {
            Explosion explosionAnimation = GetExplosionType(game, target, explosionSource);

            explosionAnimation.Start();
        }