コード例 #1
0
        protected override void ShootingPattern(GameTime gameTime)
        {
            EnemyHomingMissileBullet bullet = new EnemyHomingMissileBullet(Game, spriteSheet, player);

            bullet.Position  = Position;
            bullet.Direction = new Vector2(0, 1);
            bullet.Initialize();

            Game.stateManager.shooterState.gameObjects.Add(bullet);
        }
コード例 #2
0
        protected override void ShootingPattern(GameTime gameTime)
        {
            EnemyHomingMissileBullet bullet = new EnemyHomingMissileBullet(Game, spriteSheet, player);

            bullet.Position = Position;
            bullet.SetDirectionAgainstTarget(this, ShootObject);
            bullet.Initialize();
            bullet.Speed *= 0.6f;

            Game.stateManager.shooterState.gameObjects.Add(bullet);
        }
コード例 #3
0
        //Hanterar "shooting"
        protected override void ShootingPattern(GameTime gameTime)
        {
            double width         = Math.PI / 6;
            int    numberOfShots = 5;

            for (double dir = -width / 2 + Math.PI / 2; dir <= width / 2 + Math.PI / 2; dir += (width / numberOfShots))
            {
                EnemyHomingMissileBullet bullet = new EnemyHomingMissileBullet(Game, spriteSheet, player);
                bullet.Position  = Position;
                bullet.Direction = MathFunctions.DirFromRadians(dir);
                bullet.Initialize();

                Game.stateManager.shooterState.gameObjects.Add(bullet);
            }
        }