Exemplo n.º 1
0
        private void FrmImport_KeyDown(object sender, KeyEventArgs e)
        {
            Keys theKey = e.KeyCode;

            if (mapTested == true)
            {
                if (theKey == Keys.N)
                {
                    parentForm.Back();
                }
                if (theKey == Keys.Enter)
                {
                    parentForm.Home();
                }
                if (mapValid == true)
                {
                    if (theKey == Keys.Space)
                    {
                        parentForm.OpenExistingBuilder(filer.ReturnImportedMap(theFile));
                        //parentForm.SetPreviousForm(parentForm.GetDesigner());
                        //parentForm.SetDesignerBackButton();
                        this.Hide();
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void FrmDesigner_KeyDown(object sender, KeyEventArgs e)
        {
            Keys theKey = e.KeyCode;

            if (mapSaved == true)
            {
                if (theKey == Keys.N)
                {
                    parentForm.OpenDimensions();
                    this.Hide();
                }
                if (theKey == Keys.L)
                {
                    parentForm.OpenMapListBuilder();
                    this.Hide();
                }
                if (theKey == Keys.Enter)
                {
                    parentForm.Home();
                    this.Hide();
                }
            }
        }
Exemplo n.º 3
0
        private void FrmMap_KeyDown(object sender, KeyEventArgs e)
        {
            Keys theKey = e.KeyCode;

            if (!game.IsGameOver())
            {
                if (theKey == Keys.Up || theKey == Keys.Down || theKey == Keys.Left || theKey == Keys.Right || theKey == Keys.Enter)
                {
                    game.Run(theKey);
                    UpdateLocation();
                }
            }
            else if (theseus.IsFinished())
            {
                if (currentList == 0)
                {
                    if (filer.IsNextMap())
                    {
                        if (theKey == Keys.Space)
                        {
                            filer.SetNextMap();
                            LoadMap();
                            this.Refresh();
                            parentForm.SetClientSize(this);
                            currentMap = theMap.Name;
                        }
                    }
                    else
                    {
                        SetLabel("Congrats! You've finished!\nPress Spacebar to try a user created map, or Enter to return to the Main Menu");
                        if (theKey == Keys.Space)
                        {
                            parentForm.Back();
                        }
                        if (theKey == Keys.Enter)
                        {
                            parentForm.Home();
                        }
                    }
                }
            }
            else if (minotaur.HasEaten())
            {
                if (theKey == Keys.R)
                {
                    filer.SetMap(currentList, currentMap);
                    LoadMap();
                    this.Refresh();
                    parentForm.SetClientSize(this);
                    currentMap = theMap.Name;
                }
                if (theKey == Keys.Space)
                {
                    parentForm.Back();
                }
                if (theKey == Keys.Enter)
                {
                    parentForm.Home();
                }
            }
        }