예제 #1
0
        private void btnContinue_Click(object sender, EventArgs e)
        {
            if (radTravel.Checked == true) // Opens the game
            {
                Game game = new Game();
                game.Show();

                Form introForm = new Introduction();
                introForm.Show();
            }
            else if (radLearn.Checked == true) // Opens the map
            {
                map map = new map();
                map.Show();
            }
            else if (radHunting.Checked == true) // Open hunting
            {
                Hunting hunting = new Hunting();
                hunting.Show();
            }
            else if (radExit.Checked == true) //Closes game
            {
                this.Close();
            }
        }
예제 #2
0
        private void tmrRunGame_Tick(object sender, EventArgs e)
        {
            if (inches >= 8000)
            {
                gbEverything.Visible = false;
                picCharacter.Visible = false;
                lblEnter.Visible     = false;
                gbOptions.Visible    = false;

                lblSpace.Text    = "Press ESCAPE to close";
                lblSpace.Visible = true;
                lblEnd.Text      = "You Win!";
                lblEnd.Visible   = true;


                tmrRunGame.Stop();
            }

            if (countDown <= 0)
            {
                gbEverything.Visible = false;
                picCharacter.Visible = false;
                lblEnter.Visible     = false;
                gbOptions.Visible    = false;

                lblSpace.Text    = "Press ESCAPE to close";
                lblSpace.Visible = true;
                lblEnd.Text      = "You ran out of O2. You Lose!";
                lblEnd.Visible   = true;
                tmrRunGame.Stop();
            }


            if (mechanic <= 0)
            {
                gbEverything.Visible = false;
                picCharacter.Visible = false;
                lblEnter.Visible     = false;
                gbOptions.Visible    = false;

                lblSpace.Text    = "Press ESCAPE to close";
                lblSpace.Visible = true;
                lblEnd.Text      = "All of your mechanics are dead. You Lose!";
                lblEnd.Visible   = true;
                tmrRunGame.Stop();
            }

            picCharacter.Image = OrganTrail.Properties.Resources.Sub_clone1;
            lblFood.Text       = food + " pounds";
            lblLandmark.Text   = landmark + " inches";
            lblTime.Text       = time + ":00";
            lblHealth.Text     = health;
            lblTraveled.Text   = inches + " inches";
            lblDay.Text        = day + "";

            inches   = inches + 20;
            time     = time + 1;
            landmark = landmark - 20;
            food     = food - 12;

            if (food <= 0)
            {
                food = 0;
            }

            randomBloodcell = randNumber.Next(1, 10);

            if (randomBloodcell == 2 || randomBloodcell == 4 || randomBloodcell == 10)
            {
                picBlood1.Visible = true;
                picBlood2.Visible = true;
                picBlood3.Visible = true;
            }
            else if (randomBloodcell != 2 || randomBloodcell != 4 || randomBloodcell != 10)
            {
                picBlood1.Visible = false;
                picBlood2.Visible = false;
                picBlood3.Visible = false;
            }

            randomNumber = randNumber.Next(1, 100);

            if (landmark == -20)
            {
                tmrRunGame.Stop();
                picCharacter.Image = OrganTrail.Properties.Resources.Sub2;
                lblEvents.Text     = "You reached Landmark";
                lblEvents.Visible  = true;
                landmark           = 2000;
                lblSpace.Visible   = true;
            }



            // good- found food, found sub, find mechanic,
            // bad- lose (sick/die) a mechanic, break, Virus attack (hunting game?), sick names, wrong vein (lose day),
            //Total 8



            if (food <= 300)
            {
                lblHealth.Text = "Bad";
            }
            else if (food > 300)
            {
                lblHealth.Text = "Good";
            }

            if (randomNumber == 15 || randomNumber == 85)
            {
                lblEvents.Visible = true;
                lblEvents.Text    = "Wrong Vein. Lose 2 hours.";
                time             = time + 2;
                food             = food - 24;
                lblSpace.Visible = true;
            }
            else if (randomNumber == 69 || randomNumber == 96)
            {
                picFood.Visible   = true;
                lblEvents.Visible = true;
                lblEvents.Text    = "Find 30 lbs of food.";
                food             = food + 30;
                lblSpace.Visible = true;
            }
            else if (randomNumber == 77 || randomNumber == 25)
            {
                lblEvents.Visible = true;
                lblEvents.Text    = "Virus Attack";
                System.Threading.Thread.Sleep(1000);
                Form huntingForm = new Hunting();
                huntingForm.Show();

                lblSpace.Visible = true;
            }
            else if (randomNumber == 45 || randomNumber == 1)
            {
                lblEvents.Visible = true;
                randomSick        = randNumber.Next(1, 6);
                if (randomSick == 1)
                {
                    lblEvents.Text = txtName1.Text.ToString() + " is sick";
                }
                else if (randomSick == 2)
                {
                    lblEvents.Text = txtName2.Text.ToString() + " is sick";
                }
                else if (randomSick == 3)
                {
                    lblEvents.Text = txtName3.Text.ToString() + " is sick";
                }
                else if (randomSick == 4)
                {
                    lblEvents.Text = txtName4.Text.ToString() + " is sick";
                }
                else if (randomSick == 5)
                {
                    lblEvents.Text = txtName.Text.ToString() + " is sick";
                }

                lblSpace.Visible = true;
            }
            else if (randomNumber == 74 || randomNumber == 20)
            {
                lblEvents.Visible = true;
                lblEvents.Text    = "You found a mechanic.";
                ++mechanic;

                lblSpace.Visible = true;
            }
            else if (randomNumber == 50 || randomNumber == 10)
            {
                lblEvents.Visible = true;
                lblEvents.Text    = "Mechanic is sick.";
                time = time + 1;
                food = food - 12;

                lblSpace.Visible = true;
            }
            else if (randomNumber == 87 || randomNumber == 12)
            {
                lblEvents.Visible = true;
                lblEvents.Text    = "Mechanic dies.";
                --mechanic;
                lblSpace.Visible = true;
            }
            else if (randomNumber == 3 || randomNumber == 36)
            {
                lblEvents.Visible = true;
                lblEvents.Text    = "Found another sub. You got \n - 40 lbs food \n - 1 mechanic";
                food = food + 40;
                ++mechanic;

                lblSpace.Visible = true;
            }

            if (lblEvents.Visible == true)
            {
                tmrRunGame.Stop();
                picCharacter.Image = OrganTrail.Properties.Resources.Sub2;
            }



            if (time == 25)
            {
                tmrRunGame.Stop();
                day              = day + 1;
                countDown        = countDown - 1;
                lblDaysLeft.Text = "Days left " + countDown;

                if (tmrRunGame.Enabled == false)
                {
                    picCharacter.Image = OrganTrail.Properties.Resources.Sub2;
                    time = time - 25;

                    lblFood.Text     = food + " pounds";
                    lblLandmark.Text = landmark + " inches";
                    lblTime.Text     = time + ":00";
                    lblHealth.Text   = health;
                    lblTraveled.Text = inches + " inches";
                    lblDay.Text      = day + "";

                    if (time < 24)
                    {
                        tmrRunGame.Start();
                    }
                }
            }
        }
예제 #3
0
        private void radHunting_CheckedChanged(object sender, EventArgs e)
        {
            Hunting hunting = new Hunting();

            hunting.Show();
        }