private void FireProjectile(Point target) { WeaponProjectile projectile = Magazine.Dequeue(); Game.AddGameObject(projectile); if (ProjectilesLeftAnimation != null) { ProjectilesLeftAnimation.Start(); } }
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(); } }
public abstract void Damage(int damage, WeaponProjectile damageSource);
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); }
public static void StartExplosion(GameController game, MovableGameObject target, WeaponProjectile explosionSource) { Explosion explosionAnimation = GetExplosionType(game, target, explosionSource); explosionAnimation.Start(); }