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); }
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); }
//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); } }