Exemple #1
0
 private void shootLaser()
 {
     float barrelTip = this.GetPosition().Y + (texture.Height / 2);
     Vector2 muzzle = new Vector2(this.GetPosition().X, barrelTip);
     Laser shotLaser = new Laser(muzzle, CollisionManager.Side.Enemy);
     shotLaser.Load(Shmup.contentManager);
     Shmup.GameObjects.Add(shotLaser);
 }
Exemple #2
0
 private void fireLaser()
 {
     int fireRate = (int)MathHelper.Clamp(250 / (kills + 1), 20, 300); // shots per second increase with kills
     if (Environment.TickCount - timeLastFiredLaser > fireRate)
     {
         float barrelTip = this.GetPosition().Y - (texture.Height / 2) - 10;
         Vector2 muzzle = new Vector2(this.GetPosition().X, barrelTip);
         Laser shotLaser = new Laser(muzzle, CollisionManager.Side.Player);
         shotLaser.Load(Shmup.contentManager);
         Shmup.GameObjects.Add(shotLaser);
         timeLastFiredLaser = Environment.TickCount;
     }
 }