Ejemplo n.º 1
0
        public override void Update(GameTime gameTime)
        {
            KeyboardInputManager.Begin();

            if (KeyboardInputManager.IsKeyPressed(Keys.T))
            {
                GameCore.ChangeScene <SceneTest>();
            }

            if (KeyboardInputManager.IsKeyPressed(Keys.D1))
            {
                GameCore.ChangeScene <SpriteAnimationScene>();
            }

            if (KeyboardInputManager.IsKeyPressed(Keys.D2))
            {
                GameCore.ChangeScene <SceneGraphScene>();
            }

            if (KeyboardInputManager.IsKeyPressed(Keys.D3))
            {
                GameCore.ChangeScene <CameraScene>();
            }

            if (KeyboardInputManager.IsKeyPressed(Keys.D4))
            {
                GameCore.ChangeScene <PhysicScene>();
            }

            if (KeyboardInputManager.IsKeyPressed(Keys.D5))
            {
                GameCore.ChangeScene <TiledMapScene>();
            }

            if (KeyboardInputManager.IsKeyPressed(Keys.D6))
            {
                GameCore.ChangeScene <AetherPhysics2DHelloWorldScene>();
            }

            if (KeyboardInputManager.IsKeyPressed(Keys.D7))
            {
                GameCore.ChangeScene <QuadtreeCheckCollisionScene>();
            }

            KeyboardInputManager.End();

            base.Update(gameTime);
        }
Ejemplo n.º 2
0
        public override void Update(GameTime gameTime)
        {
            var itemEntity = _itemsEntity.FirstOrDefault(
                _ => TouchLocationRectangle.Intersects(_.GetHitBox()) && TouchLocation.State == TouchLocationState.Released);

            switch (itemEntity?.UniqueId)
            {
            case "S01":
                GameCore.ChangeScene <S01JoystickScene>();
                break;

            case "S02":
                GameCore.ChangeScene <S02TopDownCarMovementScene>();
                break;

            case "S03":
                GameCore.ChangeScene <S03AsteroidsMovementScene>();
                break;
            }

            base.Update(gameTime);
        }
Ejemplo n.º 3
0
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

            TouchLocationRectangle = Rectangle.Empty;

            var touchCollections = TouchPanel.GetState();

            if (!touchCollections.Any())
            {
                return;
            }

            TouchLocation          = touchCollections.FirstOrDefault();
            TouchLocationRectangle = new Rectangle(
                (int)TouchLocation.Position.X, (int)InvertPositionY(TouchLocation.Position.Y), 0, 0);

            if (_activeReturnButton &&
                TouchLocation.State == TouchLocationState.Released &&
                TouchLocationRectangle.Intersects(_returnButtonEntity.GetHitBox()))
            {
                GameCore.ChangeScene <MenuScene>();
            }
        }