Exemplo n.º 1
0
        public override void HandleInput(GameTime gameTime, InputState input)
        {
            //// get all of our input states
            keyboardState = Keyboard.GetState();
            //gamePadState = GamePad.GetState(PlayerIndex.One);
            touchState         = TouchPanel.GetState();
            accelerometerState = Accelerometer.GetState();

            if (maze.player.IsAlive == false)
            {
                if (keyboardState.IsKeyDown(Keys.Space) || gamePadState.IsButtonDown(Buttons.A) || touchState.Any() == true)
                {
                    maze.StartRoom().StartNewLife(ScreenManager.GraphicsDevice);
                }
            }

            // Exit the game when back is pressed.
            ///// if (gamePadState.Buttons.Back == ButtonState.Pressed)
            ////// Exit();

            bool continuePressed = keyboardState.IsKeyDown(Keys.Space) || gamePadState.IsButtonDown(Buttons.A) || touchState.Any();


            wasContinuePressed = continuePressed;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Load graphics content for the game.
        /// </summary>
        public override void Activate(bool instancePreserved)
        {
            if (!instancePreserved)
            {
                if (content == null)
                {
                    content = ScreenManager.content;
                }
                //content = new ContentManager(ScreenManager.Game.Services, CONFIG_PATH_CONTENT);

                LoadContent();

                //LOAD MAZE
                maze = new Maze(GraphicsDevice, content);
                //NOW START
                maze.StartRoom().StartNewLife(ScreenManager.GraphicsDevice);

                // once the load has finished, we use ResetElapsedTime to tell the game's
                // timing mechanism that we have just finished a very long frame, and that
                // it should not try to catch up.
                ScreenManager.Game.ResetElapsedTime();
            }
        }