예제 #1
0
        public override void Update(GameTime gameTime)
        {
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed ||
                (exitButton.Rectangle.Contains(Mouse.GetState().X, Mouse.GetState().Y) && Mouse.GetState().LeftButton == ButtonState.Pressed))
            {
                Game1.Game.Exit();
            }

            MouseState mouseState = Mouse.GetState();

            /*if (startButton.Rectangle.Contains(Mouse.GetState().X, Mouse.GetState().Y) && Mouse.GetState().LeftButton == ButtonState.Pressed)
             * {
             *  returnControl("enterbill");
             *  return;
             * }*/
            SimpleButton.UpdateAll(mouseState);
            if (startButton.Triggered)
            {
                cleanup();
                returnControl("enterbill");
                return;
            }
            else if (physicsButton.Rectangle.Contains(Mouse.GetState().X, Mouse.GetState().Y) && Mouse.GetState().LeftButton == ButtonState.Pressed)
            {
                cleanup();
                returnControl("physics");
                return;
            }

            // mute check
            checkForMute();

            // go to test
            if (Keyboard.GetState(PlayerIndex.One).IsKeyDown(Keys.T) &&
                Keyboard.GetState(PlayerIndex.One).IsKeyDown(Keys.E) &&
                Keyboard.GetState(PlayerIndex.One).IsKeyDown(Keys.S))
            {
                cleanup();
                returnControl("test");
            }

            // go to shooter level
            if (Keyboard.GetState(PlayerIndex.One).IsKeyDown(Keys.S) &&
                Keyboard.GetState(PlayerIndex.One).IsKeyDown(Keys.H) &&
                Keyboard.GetState(PlayerIndex.One).IsKeyDown(Keys.T))
            {
                cleanup();
                returnControl("shooter");
            }

            // go to rts
            if (Keyboard.GetState(PlayerIndex.One).IsKeyDown(Keys.R) &&
                Keyboard.GetState(PlayerIndex.One).IsKeyDown(Keys.T) &&
                Keyboard.GetState(PlayerIndex.One).IsKeyDown(Keys.S))
            {
                cleanup();
                returnControl("rts");
            }

            // skip to act 2
            if (Keyboard.GetState(PlayerIndex.One).IsKeyDown(Keys.S) &&
                Keyboard.GetState(PlayerIndex.One).IsKeyDown(Keys.K) &&
                Keyboard.GetState(PlayerIndex.One).IsKeyDown(Keys.I))
            {
                cleanup();
                returnControl("entercarchase");
            }

            // animate isaac
            int secondsElapsed = (int)(DateTime.Now - startTime).TotalSeconds;

            //if (!isaacAnimation.IsRunning && secondsElapsed != 0 && secondsElapsed % 5 == 0)
            if (!isaacAnimation.IsRunning && secondsElapsed % 5 == 0)
            {
                isaacAnimation.Start();
            }
            isaacAnimation.Update();
        }
예제 #2
0
 void cleanup()
 {
     SimpleButton.RemoveButton(startButton);
 }