Beispiel #1
0
        private void GameForm_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
            case Keys.Escape:
                //end game
                RunningGame.End();
                //close form
                this.Close();
                break;

            case Keys.D1:
                RunningGame.SpawnUserGeneratedItem(MouseX, MouseY, PickUpType.Cannon);
                break;

            case Keys.D2:
                RunningGame.SpawnUserGeneratedItem(MouseX, MouseY, PickUpType.Flamethrower);
                break;

            case Keys.D3:
                RunningGame.SpawnUserGeneratedItem(MouseX, MouseY, PickUpType.RocketLauncher);
                break;

            case Keys.D4:
                RunningGame.SpawnUserGeneratedItem(MouseX, MouseY, PickUpType.Tentacles);
                break;

            case Keys.D5:
                RunningGame.SpawnUserGeneratedItem(MouseX, MouseY, PickUpType.Health);
                break;

            case Keys.D6:
                RunningGame.SpawnUserGeneratedItem(MouseX, MouseY, PickUpType.Shield);
                break;

            case Keys.Space:
                RunningGame.EscapeCurrentIntro();
                break;
            }
        }