Update() public method

public Update ( ) : void
return void
Example #1
0
        public NUKE.Game1.GameState update(Microsoft.Xna.Framework.GameTime gametime)
        {
            nukes.buidlingCount = buildings.building_count;
            if (buildings.building_count <= 0)
            {
                pause.Pause_State = PauseScreen.pause_state.HighScore;
                pause.pause       = PauseScreen.Pause.unpaused;
                pause.Getscore    = Score;
                buildings.reset();
                buildings.building_count = 20;
                nukes.Reset_location();
            }
            Score = (nukes.Points);
            KeyboardState newState = Keyboard.GetState();

            if ((oldState.IsKeyUp(Keys.Escape) || oldState.IsKeyUp(Keys.Up)) && (newState.IsKeyDown(Keys.Escape) || newState.IsKeyDown(Keys.Up)))
            {
                if (pause.finish == true)
                {
                    if (pause.pause == PauseScreen.Pause.Paused)
                    {
                        pause.pause = PauseScreen.Pause.unpaused;
                    }
                    else
                    {
                        pause.pause = PauseScreen.Pause.Paused;
                    }
                }
            }

            pause.Update(gametime, this);
            switch (pause.pause)
            {
            case PauseScreen.Pause.Paused:
                buildings.update(gametime, nukes.destruciton);
                nukes.update(gametime);
                break;

            case PauseScreen.Pause.unpaused:

                break;
            }


            oldState = newState;

            return(pause.Returns);
        }