private static void Form_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Space) { System.Media.SystemSounds.Beep.Play(); _bullets.Add(new Bullet(new Point(_ship.Rect.X + 10, _ship.Rect.Y + 4), new Point(4, 0), new Size(4, 1))); } if (e.KeyCode == Keys.Up) { _ship.Up(); } if (e.KeyCode == Keys.Down) { _ship.Down(); } }
private static void Form_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.ControlKey) { bullet = new Bullet(new Point(ship.Rect.X + 100, ship.Rect.Y + 8), new Point(4, 0), new Size(6, 3)); } if (e.KeyCode == Keys.Up) { ship.Up(); } if (e.KeyCode == Keys.Down) { ship.Down(); } }