예제 #1
0
 public static void StartExplosion(GameController game, MovableGameObject target, Type explosionType)
 {
     object[] parameters = new object[2];
     parameters[0] = game;
     parameters[1] = target;
     Explosion explosion = (Explosion)Activator.CreateInstance(explosionType, parameters);
 }
예제 #2
0
 public Weapon(GameController game, MovableGameObject holder) : base(game)
 {
     Holder = holder;
     Initialize();
     projectileSpawnPoint = GetProjectileSpawnPoint();
     OnPositionChanged   += Weapon_OnPositionChanged;
 }
예제 #3
0
 public Explosion(GameController game, MovableGameObject target) : base(game, target)
 {
     Initialize();
     if (ParticleSize == 0)
     {
         ParticleSize = 7.5;
     }
     explosionParticles = GetExplosionParticles();
     StartExplosion();
 }
예제 #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);
        }
예제 #5
0
 public void RemoveGameObject(MovableGameObject obj)
 {
     PlayArea.Children.Remove(obj.Model);
     if (obj is Enemy)
     {
         enemies.Remove(obj as Enemy);
     }
     if (obj is IUpdate)
     {
         updatingObjects.Remove(obj as IUpdate);
     }
     if (obj is ICollidableGameObject)
     {
         collidableGameObjects.Remove(obj as ICollidableGameObject);
     }
 }
예제 #6
0
 public TankBulletExplosion(GameController game, MovableGameObject target) : base(game, target)
 {
 }
예제 #7
0
 public PathFollower(GameController game, MovableGameObject follower)
 {
     this.game     = game;
     this.follower = follower;
     Initialize();
 }
예제 #8
0
 public TankMachineGun(GameController game, MovableGameObject holder) : base(game, holder)
 {
 }
 public WaterTurretProjectileExplosion(GameController game, MovableGameObject target) : base(game, target)
 {
 }
예제 #10
0
 public SmallExplosion(GameController game, MovableGameObject target) : base(game, target)
 {
 }
예제 #11
0
        public static void StartExplosion(GameController game, MovableGameObject target, WeaponProjectile explosionSource)
        {
            Explosion explosionAnimation = GetExplosionType(game, target, explosionSource);

            explosionAnimation.Start();
        }
예제 #12
0
 public TankMissileLauncher(GameController game, MovableGameObject holder) : base(game, holder)
 {
 }