示例#1
0
        public override bool ProcessKeyboard(KeyboardInfo info)
        {
            Point newPosition = Point.Zero;

            if (info.IsKeyReleased(Keys.Up))
            {
                PlayerControlComponent p = ComponentManager.GetComponent <PlayerControlComponent>(0);
                p.SetAction(new MoveAction(EntityManager.Player, new Point(0, -1), 10));
            }
            else if (info.IsKeyReleased(Keys.Down))
            {
                PlayerControlComponent p = ComponentManager.GetComponent <PlayerControlComponent>(0);
                p.SetAction(new MoveAction(EntityManager.Player, new Point(0, 1), 10));
            }
            else if (info.IsKeyReleased(Keys.Left))
            {
                PlayerControlComponent p = ComponentManager.GetComponent <PlayerControlComponent>(0);
                p.SetAction(new MoveAction(EntityManager.Player, new Point(-1, 0), 10));
            }
            else if (info.IsKeyReleased(Keys.Right))
            {
                PlayerControlComponent p = ComponentManager.GetComponent <PlayerControlComponent>(EntityManager.Player);
                p.SetAction(new MoveAction(EntityManager.Player, new Point(1, 0), 10));
            }
            else if (info.IsKeyReleased(Keys.C))
            {
                PlayerControlComponent p = ComponentManager.GetComponent <PlayerControlComponent>(EntityManager.Player);
                p.SetAction(new CloseAction(EntityManager.Player));
            }
            //else if ( info.IsKeyReleased( Keys.Left ) )
            //{
            //	newPosition.X -= 1;
            //	keyHit = true;
            //}
            //else if ( info.IsKeyReleased( Keys.Right ) )
            //{
            //	newPosition.X += 1;
            //	keyHit = true;
            //}


            //// Test location
            //if ( keyHit )
            //{

            //	Map.MoveActor( GameConstants.player, newPosition );
            //	//UpdatePlayerView();

            //}
            return(false);
        }
示例#2
0
        public override bool ProcessKeyboard(KeyboardInfo info)
        {
            if (info.IsKeyReleased(Keys.Space))
            {
                Renderer         = _renderer == oldRenderer ? cachedRenderer : oldRenderer;
                TextSurface.Tint = _renderer == oldRenderer ? Color.Transparent : new Color(255, 255, 255, 70);
            }

            return(false);
        }
示例#3
0
        public override bool ProcessKeyboard(KeyboardInfo info)
        {
            // If the space key is pressed, run the fade
            if (info.IsKeyReleased(Keys.Space))
            {
                startFade = true;
            }

            // Do not pass the keyboard input to the child consoles, eat it.
            return(true);
        }
示例#4
0
        public override bool ProcessKeyboard(KeyboardInfo info)
        {
            if (info.IsKeyReleased(Keys.C))
            {
                backIndex++;

                if (backIndex == backgroundcycle.Length)
                {
                    backIndex = 0;
                }

                var theme = Theme;
                theme.FillStyle.Background = backgroundcycle[backIndex];
                Theme = theme;
            }


            return(base.ProcessKeyboard(info));
        }