public static void FireMissile(Vector2 direction, Vector2 position)
 {
     if (direction.Length() > 0 && position.Length() > 0)
     {
         Projectile p = new ProjectileMissile(Config.CurrentProjectile);
         p.Position = position + new Vector2(1, 0);
         p.Direction = direction;
         p.Speed = Config.MissileSpeed;
         p.Damage = Config.MissileDamage;
         p.Health = Config.MissileDamage;
         p.CollisionList = Enemy.Enemies;
         p.CollisionList2 = EnemyPlayerShip.EnemyPlayerShips;
         p.startPosition = position;
         
         //p.ExplosionSpriteSheet = Config.ProjectileExplosion;
     }
 } 
예제 #2
0
 //TODO: maybe replace with new class of enemy projectile/projectile bullet type
 void FireBullet(Vector2 direction, Vector2 position)
 {
     if (!this.Dead)
     {
         Projectile bullet = new ProjectileMissile(Config.EnemyPlayerBulletSheet);
         bullet.CollisionList = Enemy.Enemies;
         bullet.Position = position;
         bullet.Direction = direction;
         bullet.Speed = Config.EnemyBulletSpeed;
         bullet.Damage = Config.EnemyBulletDamage;
         //bullet.ExplosionSpriteSheet = Config.ProjectileExplosion;
     }
 }