예제 #1
0
        private void menuItem_Selected(object sender, EventArgs e)
        {
            if (sender == newGame)
            {
                Transition(ChangeType.Push, GameRef.NewGameScreen);
            }

            if (sender == continueGame)
            {
                //Transition(ChangeType.Push, GameRef.LoadGameScreen);

                if (sender == exitGame)
                {
                    GameRef.Exit();
                }
            }
        }
예제 #2
0
        private void menuItem_Selected(object sender, EventArgs e)
        {
            if (sender == startGame)
            {
                StateManager.PushState(GameRef.GamePlayScreen);
            }

            if (sender == loadGame)
            {
                StateManager.PushState(GameRef.GamePlayScreen);
            }

            if (sender == exitGame)
            {
                GameRef.Exit();
            }
        }
예제 #3
0
        private void menuItem_Selected(object sender, EventArgs e)
        {
            if (sender == startGame)
            {
                Transition(ChangeType.Push, GameRef.CharacterGeneratorScreen);
            }

            if (sender == loadGame)
            {
                Transition(ChangeType.Push, GameRef.LoadGameScreen);
            }

            if (sender == exitGame)
            {
                GameRef.Exit();
            }
        }
예제 #4
0
        private void menuItem_Selected(object sender, EventArgs e)
        {
            if (sender == startGame)
            {
                StateManager.PushState(GameRef.initPrice);
                // Change this so it goes to the Inisital Price
            }

            if (sender == loadGame)
            {
                StateManager.PushState(GameRef.saveHistory);
            }

            if (sender == exitGame)
            {
                GameRef.Exit();
            }
        }
예제 #5
0
        /* This function is called when one of the menu items is selected. */
        private void menuItem_Selected(object sender, EventArgs e)
        {
            /* If the selected menu item is the newGame LinkLabel, the CharacterSelectScreen is pushed onto the state stack. */
            if (sender == newGame)
            {
                Change(ChangeType.Push, GameRef.CharacterSelectScreen);
            }

            /* If the selected menu item is the loadGame LinkLabel, then the LoadGameScreen is pushed onto the state stack. */
            if (sender == loadGame)
            {
                Change(ChangeType.Push, GameRef.LoadGameScreen);
            }

            /* Finally, if the selected menu item is the exitGame LinkLabel, then the game exits. */
            if (sender == exitGame)
            {
                GameRef.Exit();
            }
        }
예제 #6
0
        private void menuItem_Selected(object sender, EventArgs e)
        {
            if (sender == startGame)
            {
                StateManager.PushState(GameRef.MapScreen);
                //GameRef.spriteBatch.End();
            }

            if (sender == loadGame)
            {
                StateManager.PushState(GameRef.MapScreen);
            }
            if (sender == options)
            {
                //StateManager.PushState(GameRef.OptionScreen);
            }

            if (sender == exitGame)
            {
                GameRef.Exit();
            }
        }
예제 #7
0
        private void menuItem_Selected(object sender, EventArgs e)
        {
            if (sender == startGame)
            {
                GameRef.spaceShip.setGameState("playing");
                StateManager.PushState(GameRef.initPrice);
            }

            if (sender == loadGame)
            {
                StateManager.PushState(GameRef.GamePlayScreen);
            }

            if (sender == exitGame)
            {
                GameRef.Exit();
            }
            if (sender == highscore)
            {
                StateManager.PushState(GameRef.highscoreScreen);
            }
        }
예제 #8
0
        private void menuItem_Selected(object sender, EventArgs e)
        {
            if (sender == startGame)
            {
                StateManager.PushState(GameRef.AdminScreen, "");
                // this is to add resources to the new game
                // this adds a delay into the start up may need to change this or thread it
                dbp.Startresourceadd();
                dbp.startPlanetAdd();
                dbp.AddtoSession(dbp.newSession());
            }

            if (sender == loadGame)
            {
                StateManager.PushState(GameRef.GamePlayScreen, "");
            }

            if (sender == exitGame)
            {
                GameRef.Exit();
            }
        }
예제 #9
0
        public override void Update(GameTime gameTime)
        {
            if (hasPopped)
            {
                Reset();
                hasPopped = false;
            }

            StoryTime += (float)gameTime.ElapsedGameTime.TotalSeconds;
            if (StatusBar.Health <= 0)
            {
                GameOver(this, null);
            }
            if (Input_Handler.KeyReleased(Keys.Escape))
            {
                GameRef.Exit();
            }

            if (ObjManager.MoneyGain > 0)
            {
                Gold                += ObjManager.TakeMoney();
                StatusBar.Gold      += Gold;
                GameRef.player.gold += Gold;
                Gold                 = 0;
            }
            if (ObjManager.DamageGiven > 0)
            {
                Damage            = ObjManager.TakeDamage();
                StatusBar.Health -= Damage;
                Damage            = 0;
            }
            if (counter != 5)
            {
                time += gameTime.ElapsedGameTime.TotalMilliseconds;
            }

            if (Input_Handler.KeyPressed(Keys.F11))
            {
                if (DevelopmentMode == false)
                {
                    DevelopmentMode = true;
                }
                else
                {
                    DevelopmentMode = false;
                }
            }

            #region Development
            if (DevelopmentMode)
            {
                if (Input_Handler.KeyPressed(Keys.I))
                {
                    //Waypoints.Enqueue(new Vector2(Mouse.GetState().X, Mouse.GetState().Y));
                }
                if (Input_Handler.KeyPressed(Keys.P))
                {
                    if (plotTexture == false)
                    {
                        GameRef.MousePointer = texTeleport;
                        //gamePlayMouse.Update(gameTime, arrowTexture);
                        plotTexture = true;
                    }
                    else
                    {
                        GameRef.MousePointer = Game.Content.Load <Texture2D>(@"UI Content\Pointer");
                        //gamePlayMouse.Update(gameTime, arrowTexture);
                        plotTexture = false;
                    }
                }
                if (Mouse.GetState().LeftButton == ButtonState.Pressed && placeLock == false)
                {
                    //save plot position
                    if (level == 0)
                    {
                        writer = new StreamWriter(@"GameData\Plot.txt", true);
                    }
                    else if (level == 1)
                    {
                        writer = new StreamWriter(@"GameData\Plot1.txt", true);
                    }
                    else if (level == 2)
                    {
                        writer = new StreamWriter(@"GameData\Plot2.txt", true);
                    }
                    else if (level == 3)
                    {
                        writer = new StreamWriter(@"GameData\Plot3.txt", true);
                    }

                    writer.WriteLine(Mouse.GetState().X.ToString() + "_" + Mouse.GetState().Y.ToString());
                    writer.Close();

                    ObjManager.AddLst.Add(new Plot(Content.Load <Texture2D>(@"UI Content\teleport_128"), new Vector2(Mouse.GetState().X, Mouse.GetState().Y), 5, 1, 0f, 0, 0, 0));

                    placeLock = true;
                }
                if (placeLock == true && Mouse.GetState().LeftButton == ButtonState.Released)
                {
                    placeLock = false;
                }
                if (Input_Handler.KeyPressed(Keys.O))
                {
                    writer = new StreamWriter(@"GameData\Plot.txt", true);
                    writer.Dispose();
                    writer.Close();
                    for (int x = 0; x < ObjManager.Count - 1; x++)
                    {
                        if (ObjManager[x].Type == "Plot")
                        {
                            ObjManager.RemoveAt(x);
                        }
                    }
                }
                #endregion
            }

            ObjManager.Update(gameTime);


            base.Update(gameTime);
        }
예제 #10
0
 private void Quit_Selected(object sender, EventArgs e)
 {
     GameRef.Exit();
 }