Exemplo n.º 1
0
        protected override void ShootingPattern(GameTime gameTime)
        {
            int activationTimeMilliseconds = 500;

            EnemyMine mine = new EnemyMine(Game, spriteSheet, player);

            mine.Initialize();
            mine.Position = Position;
            mine.SetActivationTime(activationTimeMilliseconds);
            mine.Direction = MathFunctions.ScaleDirection(ShootObject.Position - Position);
            mine.Speed     = 0.10f;
            mine.Duration  = 1000;

            Game.stateManager.shooterState.gameObjects.Add(mine);
        }
Exemplo n.º 2
0
        protected override void ShootingPattern(GameTime gameTime)
        {
            Vector2 centerDir  = new Vector2(0, 1.0f);
            double  dirRadians = MathFunctions.RadiansFromDir(centerDir);

            dirRadians += random.NextDouble() * Math.PI / 8 - Math.PI / 16;

            EnemyMine mine = new EnemyMine(Game, spriteSheet, player);

            mine.Position  = Position;
            mine.Direction = MathFunctions.DirFromRadians(dirRadians);
            mine.Initialize();

            mine.SetActivationTime(mineActivationTime);

            Game.stateManager.shooterState.gameObjects.Add(mine);
        }
Exemplo n.º 3
0
        protected override void SecondaryShootingPattern(GameTime gameTime)
        {
            int       activationTimeMilliseconds = 500;
            EnemyMine mine = new EnemyMine(Game, spriteSheet, player);

            mine.Initialize();
            mine.SetActivationTime(activationTimeMilliseconds);
            mine.Position = Position;

            mine.Direction = MathFunctions.ScaleDirection(ShootObject.Position - Position);
            mine.Speed     = 0.15f;

            float distance = MathFunctions.ObjectDistance(this, ShootObject);

            // Shoots at a location close to the players current
            mine.Duration = distance / mine.Speed * 0.9f;

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