示例#1
0
        private void OnKeyDown(Spartacus.Game.Keys p_key)
        {
            if (!v_paused)
            {
                switch (p_key)
                {
                case Spartacus.Game.Keys.Up:
                    v_racket_right.Move(0, -10, true);
                    break;

                case Spartacus.Game.Keys.Down:
                    v_racket_right.Move(0, 10, true);
                    break;

                case Spartacus.Game.Keys.A:
                    v_racket_left.Move(0, -10, true);
                    break;

                case Spartacus.Game.Keys.Z:
                    v_racket_left.Move(0, 10, true);
                    break;

                default:
                    break;
                }
            }
        }
示例#2
0
        private void OnKeyPress(Spartacus.Game.Keys p_key)
        {
            if (p_key == Spartacus.Game.Keys.Space)
            {
                v_paused = !v_paused;
            }

            if (v_paused)
            {
                v_text_paused.SetMessage("PAUSED");
            }
            else
            {
                v_text_paused.SetMessage("");
            }
        }
示例#3
0
        private void OnKeyDown(Spartacus.Game.Keys p_key)
        {
            switch (p_key)
            {
            case Spartacus.Game.Keys.Up:
                if (this.v_mapview_y > 0)
                {
                    this.v_mapview_y--;
                    this.BuildMapView();
                }
                break;

            case Spartacus.Game.Keys.Down:
                if (this.v_mapview_y < (this.v_map_size - this.v_mapview_height))
                {
                    this.v_mapview_y++;
                    this.BuildMapView();
                }
                break;

            case Spartacus.Game.Keys.Left:
                if (this.v_mapview_x > 0)
                {
                    this.v_mapview_x--;
                    this.BuildMapView();
                }
                break;

            case Spartacus.Game.Keys.Right:
                if (this.v_mapview_x < (this.v_map_size - this.v_mapview_width))
                {
                    this.v_mapview_x++;
                    this.BuildMapView();
                }
                break;

            default:
                break;
            }
        }