Пример #1
0
        protected override void ShootingPattern(GameTime gameTime)
        {
            EnemyWeakBlueLaser laser1 = new EnemyWeakBlueLaser(Game, spriteSheet);

            laser1.PositionX = PositionX;
            laser1.PositionY = PositionY;
            laser1.Direction = MathFunctions.ScaleDirection(ShootObject.Position - Position);
            laser1.Initialize();
            laser1.Duration *= 1.5f;

            Game.stateManager.shooterState.gameObjects.Add(laser1);
        }
Пример #2
0
        protected override void ShootingPattern(GameTime gameTime)
        {
            double width         = Math.PI / 6;
            int    numberOfShots = 3;

            for (double dir = Math.PI / 2 - width / 2; dir <= Math.PI / 2 + width / 2; dir += (width / (numberOfShots - 1)))
            {
                EnemyWeakBlueLaser laser1 = new EnemyWeakBlueLaser(Game, spriteSheet);
                laser1.Position  = Position;
                laser1.Direction = MathFunctions.DirFromRadians(dir);
                laser1.Initialize();
                laser1.Duration *= 10;
                laser1.DrawLayer = this.DrawLayer - 0.01f;

                Game.AddGameObjToShooter(laser1);
            }
        }
        protected override void ShootingPattern(GameTime gameTime)
        {
            double width         = Math.PI / 12;
            double numberOfShots = 3;

            foreach (double dir in MathFunctions.GetSpreadDirList(width, numberOfShots))
            {
                EnemyWeakBlueLaser laser1 = new EnemyWeakBlueLaser(Game, spriteSheet);
                laser1.PositionX = PositionX;
                laser1.PositionY = PositionY;
                laser1.Direction = MathFunctions.DirFromRadians(dir);
                laser1.Initialize();
                laser1.Speed    *= 1.5f;
                laser1.Duration *= 2.0f;

                Game.stateManager.shooterState.gameObjects.Add(laser1);
            }
        }
Пример #4
0
        protected override void ShootingPattern(GameTime gameTime)
        {
            int numberOfShots = 10;

            for (int n = 0; n < numberOfShots; n++)
            {
                EnemyWeakBlueLaser laser1 = new EnemyWeakBlueLaser(Game, spriteSheet);
                laser1.Position  = Position;
                laser1.Direction = new Vector2(0, 1);
                laser1.Direction = MathFunctions.SpreadDir(laser1.Direction, Math.PI / 8);
                laser1.Initialize();
                laser1.DrawLayer = this.DrawLayer - 0.01f;
                laser1.SetSpreadSpeed(random);
                laser1.Duration *= 2;

                Game.AddGameObjToShooter(laser1);
            }
        }