示例#1
0
        //Starts new game
        private void newGameToolStripMenuItem_Click(object sender, EventArgs e)
        {
            newGame = true;
            actionToPerform = 5;
            MessageBox.Show("New game has been started");
            thisGame = new GameController();
            lblStory.Text = thisGame.ThisDecision.MoveStoryLine(true);//Working on a story controller for this
            //ShowControls(true);
            lblRoomInv.Text = "";
            lblPlayerInv.Text = "";
            lblRoomDescription.Text = "";
            lblLocationInfo.Text = "";

            thisGame.ThisAction.LoadOrCreateRoom(thisGame.ThisRoomInfo.GetRoom("Outside"), thisGame.ThisItemList.GetItems("Outside"));
            thisGame.ThisAction.ThisRoom.LoadExits(thisGame.ThisRoomInfo.GetExits());
            UpdateExits();
            ShowControls();
        }
示例#2
0
 //Loads the game
 private void loadGameToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Stream gameFile = File.Open("data.dat",FileMode.Open);
     BinaryFormatter formatter = new BinaryFormatter();
     thisGame = (GameController)formatter.Deserialize(gameFile);
     gameFile.Close();
     MessageBox.Show("Game has been loaded");
     UpdateRoomInventory();
     UpdatePlayerInventory();
     UpdateExits();
     lblLocationInfo.Text += thisGame.ThisAction.ThisRoom.Name;
     lblRoomDescription.Text += thisGame.ThisAction.ThisRoom.Description;
     lblStory.Text = thisGame.ThisDecision.StoryLine;
     ShowControls();
        // CheckForPuzzle();
 }