Ejemplo n.º 1
0
 private static void Form_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.ControlKey && _bullets.Count < _maxBullets)
     {
         _bullets.Add(new Bullet(new Point(_ship.Rect.X + _ship.Rect.Width / 2, _ship.Rect.Y + _ship.Rect.Height / 2), new Point(4, 0), new Size(4, 1)));
     }
     if (e.KeyCode == Keys.Up)
     {
         _ship.Up();
     }
     if (e.KeyCode == Keys.Down)
     {
         _ship.Down();
     }
     if (e.KeyCode == Keys.Escape)
     {
         _close();
     }
 }