示例#1
0
 public void renderQuestion(InGameRenderInfo info)
 {
     if (info.askQuestion)
     {
         if (currentQ == 0)
         {
             numOfQ       = info.numOfQuestions;
             playerChoice = new String[numOfQ];
         }
         panel1.Visible = true;
         question(info.question[currentQ]);
         answerChoices(info.answers[currentQ]);
         disableButtons();
     }
 }
示例#2
0
 public Room(int cavenum)
 {
     InitializeComponent();
     this.cavenum      = cavenum;
     game              = new GameControl(cavenum);
     renderInformation = game.updateRender();
     playerChoice      = new String[renderInformation.numOfQuestions];
     room1.Visible     = false;
     room2.Visible     = false;
     room3.Visible     = false;
     room4.Visible     = false;
     room5.Visible     = false;
     room6.Visible     = false;
     //correctness.Text = ""; To implement later
 }
        //resets all objects to initial states, takes the number of cave as parameter
        public void startGame(int cavenum)
        {
            //initializes fields
            map    = new Map(cavenum);
            render = new InGameRenderInfo();
            trivia = new Trivia();
            scores = new HighScore();
            player = new Player();
            reason = 0;
            loadFact();

            //loads cave pathways into render to be displayed
            render.CaveConnections = map.getConnections();
            //updates render to be displayed
            updateRender();
        }
示例#4
0
 private void implementHazardPics(InGameRenderInfo info)
 {
     if (info.roomNum == info.wumpusLocation)
     {
         wumpusPicture.Visible = true;
     }
     else
     {
         wumpusPicture.Visible = false;
     }
     if (info.roomNum == info.pitlocation1 || info.roomNum == info.pitlocation2)
     {
         pitPicture.Visible  = true;
         playerImage.Visible = false;
     }
     else
     {
         playerImage.Visible = true;
         pitPicture.Visible  = false;
     }
     if (info.roomNum == info.batlocation1 || info.roomNum == info.batlocation2)
     {
         batPicture.Visible = true;
     }
     else
     {
         batPicture.Visible = false;
     }
     //if (info.popUp == 1)
     //{
     //    batPicture.Visible = true;
     //    pitPicture.Visible = false;
     //}
     //else if(info.popUp == 2)
     //{
     //    pitPicture.Visible = true;
     //    playerImage.Visible = false;
     //}
     //else if(info.popUp == 3)
     //{
     //    wumpusPicture.Visible = true;
     //}
 }
示例#5
0
        private String renderPop(InGameRenderInfo info)
        {
            String message = "";

            for (int i = 0; i < info.popUp.Count; i++)
            {
                switch ((int)info.popUp[i])
                {
                case 0:
                    message += "";
                    break;

                case 1:
                    message = "You have been moved to a random room by bats.";
                    break;

                case 2:
                    message = "You fall into a pit! Answer two of three questions correctly to escape.";
                    break;

                case 3:
                    message = "You encounter the Wumpus! Answer three of his five questions to wound him!";
                    break;

                case 4:
                    message = "You escape the pit! You've been returned to where you started.";
                    break;

                case 6:
                    message = "You wound the Wumpus and he escapes";
                    break;

                case 8:
                    message = "You hit the Wumpus!";
                    break;

                case 9:
                    message = "You miss the Wumpus, it has now moved to a different room";
                    break;
                }
            }
            return(message);
        }
示例#6
0
        //public void renderQuestion(InGameRenderInfo info)
        //{
        //    if (info.askQuestion)
        //    {
        //        question(info.question[currentQ]);
        //        answerChoices(info.answers[currentQ]);
        //    }
        //}
        private String renderPop(InGameRenderInfo info)
        {
            String message = "";

            switch (info.popUp)
            {
            case 0:
                message = "";
                break;

            case 1:
                message = "You encounter bats. You have been moved to a random room.";
                break;

            case 2:
                message = "You fall into a pit! Answer two of three questions correctly to escape.";
                break;

            case 3:
                message = "You encounter the Wumpus! Answer three of his five questions to wound him!";
                break;

            case 4:
                message = "You escape the pit! You've been returned to where you started.";
                break;

            case 5:
                message = "You fall to your death.";
                break;

            case 6:
                message = "You wound the Wumpus and he escapes";
                break;

            case 7:
                message = "You are eaten by the Wumpus";
                break;
            }
            return(message);
        }
示例#7
0
        private void RenderScene(InGameRenderInfo info)
        {
            //game.updateFact();
            label1.Text      = "Gold Count: " + info.GoldCount.ToString();
            label2.Text      = "Arrow Count: " + info.ArrowCount.ToString();
            turnLabel.Text   = "Number of Turns: " + info.numberOfTurns.ToString();
            playerScore.Text = "Score: " + info.score.ToString();
            roomLabel.Text   = info.roomNum.ToString();
            label5.Text      = info.wumpusLocation.ToString();
            label6.Text      = info.pitlocation1.ToString();
            label7.Text      = info.pitlocation2.ToString();
            label8.Text      = info.batlocation1.ToString();
            label9.Text      = info.batlocation2.ToString();
            button1.Text     = Math.Abs(info.currentPaths[0]).ToString();
            button2.Text     = Math.Abs(info.currentPaths[1]).ToString();
            button3.Text     = Math.Abs(info.currentPaths[2]).ToString();
            button4.Text     = Math.Abs(info.currentPaths[3]).ToString();
            button5.Text     = Math.Abs(info.currentPaths[4]).ToString();
            button6.Text     = Math.Abs(info.currentPaths[5]).ToString();
            implementHazardPics(game.render);
            if (info.currentPaths[0] > 0)
            {
                button1.Visible = true;
                button1.Enabled = true;
            }
            else
            {
                button1.Enabled = false;
            }

            if (info.currentPaths[1] > 0)
            {
                button2.Visible = true;
                button2.Enabled = true;
            }
            else
            {
                button2.Enabled = false;
            }

            if (info.currentPaths[2] > 0)
            {
                button3.Visible = true;
                button3.Enabled = true;
            }
            else
            {
                button3.Enabled = false;
            }
            if (info.currentPaths[3] > 0)
            {
                button4.Visible = true;
                button4.Enabled = true;
            }
            else
            {
                button4.Enabled = false;
            }
            if (info.currentPaths[4] > 0)
            {
                button5.Visible = true;
                button5.Enabled = true;
            }
            else
            {
                button5.Enabled = false;
            }
            if (info.currentPaths[5] > 0)
            {
                button6.Visible = true;
                button6.Enabled = true;
            }
            else
            {
                button6.Enabled = false;
            }

            if (info.askQuestion)
            {
                panel1.Visible = true;
            }
            else
            {
                panel1.Visible = false;
            }
            textDisplay.Text  = renderPop(info) + "\n";
            textDisplay.Text += "Warnings: \n";
            for (int i = 0; i < info.warnings.Count; i++)
            {
                textDisplay.Text += info.warnings[i] + "\n";
            }
            if (!game.render.secret.Equals(""))
            {
                textDisplay.Text += "Last Secret Bought:\n" + game.render.secret;
            }

            textDisplay.Text += "Trivia: " + game.render.fact;
            endGameScreen();
        }
示例#8
0
        private void RenderScene(InGameRenderInfo info)
        {
            label1.Text      = "Gold Count: " + info.GoldCount.ToString();
            label2.Text      = "Arrow Count: " + info.ArrowCount.ToString();
            turnLabel.Text   = "Number of Turns: " + info.numberOfTurns.ToString();
            playerScore.Text = "Score: " + info.score.ToString();
            RoomNum.Text     = "Room: " + info.roomNum;
            renderPop(info);
            if (info.currentPaths[0] > 0)
            {
                room1.Visible = true;
            }
            else
            {
                room1.Visible = false;
            }

            if (info.currentPaths[1] > 0)
            {
                room2.Visible = true;
            }
            else
            {
                room2.Visible = false;
            }

            if (info.currentPaths[2] > 0)
            {
                room3.Visible = true;
            }
            else
            {
                room3.Visible = false;
            }
            if (info.currentPaths[3] > 0)
            {
                room4.Visible = true;
            }
            else
            {
                room4.Visible = false;
            }
            if (info.currentPaths[4] > 0)
            {
                room5.Visible = true;
            }
            else
            {
                room5.Visible = false;
            }
            if (info.currentPaths[5] > 0)
            {
                room6.Visible = true;
            }
            else
            {
                room6.Visible = false;
            }

            //if (info.askQuestion)
            //{
            //    renderQuestion(info);
            //    panel1.Visible = true;
            //}
            //else
            //{
            //    panel1.Visible = false;
            //}
            //textDisplay.Text = "";
            //for (int i = 0; i < info.warnings.Count; i++)
            //{
            //    textDisplay.Text += renderPop(info);
            //    textDisplay.Text += info.warnings[i] + "\n";
            //}
            //renderQuestion(info);
        }