Esempio n. 1
0
 public void Shoot(ScreenManager screenManager, InputState input, Weapon weapon, GameTime gameTime, List <Missile> missiles)
 {
     if (gameTime.TotalGameTime.TotalSeconds - timeLastShot.TotalSeconds > Unit.shotFrequency && !isDying)
     {
         timeLastShot = new TimeSpan(gameTime.TotalGameTime.Days, gameTime.TotalGameTime.Hours, gameTime.TotalGameTime.Minutes, gameTime.TotalGameTime.Seconds, gameTime.TotalGameTime.Milliseconds);
         missiles.Add(Missile.FromWeapon(weapon, position + new Vector2(0, -20), new Vector2(input.CurrentMouseState.X - GameInterface.Width - (screenManager.Settings.Resolution.X - GameInterface.Width) / 2 + camera.Pos.X, input.CurrentMouseState.Y - screenManager.Settings.Resolution.Y / 2 + camera.Pos.Y), timeLastShot, Faction.Fighters, gameTime));
         missiles.Last().Load(screenManager.Game.Content);
     }
 }
Esempio n. 2
0
 public void Shoot(ScreenManager screenManager, Weapon weapon, GameTime gameTime, List <Missile> missiles)
 {
     if (gameTime.TotalGameTime.TotalSeconds - timeLastShot.TotalSeconds > Unit.shotFrequency && !isDying && aware)
     {
         timeLastShot = new TimeSpan(gameTime.TotalGameTime.Days, gameTime.TotalGameTime.Hours, gameTime.TotalGameTime.Minutes, gameTime.TotalGameTime.Seconds, gameTime.TotalGameTime.Milliseconds);
         missiles.Add(Missile.FromWeapon(weapon, position + new Vector2(0, -20), new Vector2(target.position.X, target.position.Y), timeLastShot, Faction.Enemies, gameTime));
         missiles.Last().Load(screenManager.Game.Content);
     }
 }