示例#1
0
        private void FrmMap_KeyDown(object sender, KeyEventArgs e)
        {
            MoveDir dir = MoveDir.NO_MOVE;

            switch (e.KeyCode)
            {
            case Keys.Left:
                dir = MoveDir.LEFT;
                break;

            case Keys.Right:
                dir = MoveDir.RIGHT;
                break;

            case Keys.Up:
                dir = MoveDir.UP;
                break;

            case Keys.Down:
                dir = MoveDir.DOWN;
                break;
            }
            if (dir != MoveDir.NO_MOVE)
            {
                character.Move(dir);
                if (game.State == GameState.FIGHTING)
                {
                    FrmArena frmArena = new FrmArena(inventory, "reg");
                    frmArena.Show();
                }
                if (game.State == GameState.LVL2)    // if the player lands on the lvl 2 square, the old map is hidden and the new map is formed
                {
                    FrmMap frmMap = new FrmMap(true, true);
                    frmMap.Show();
                    this.Close();
                }
                else if (game.State == GameState.LVL1)   // for when in lvl 2, go back to lvl 1 if on square
                {
                    FrmMap frmMap = new FrmMap(true, true);
                    frmMap.Show();
                    this.Close();
                }
                else if (game.State == GameState.TITLE_SCREEN)
                {
                    var newForm = new FrmMainMenu();
                    newForm.Show();
                    this.Close();
                }
                if (game.State == GameState.BOSS)
                {
                    FrmArena frmArena = new FrmArena(inventory, "boss");
                    frmArena.Show();
                }
            }
        }
示例#2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            //Application.Run(new FrmMap());
            var newForm = new FrmMainMenu();

            newForm.ControlBox = false;
            newForm.Show();
            Application.Run();
        }