예제 #1
0
        void game_OnCheckGameInputs(MainGameEventArgs e)
        {
            WinAPIUtil.POINT pt    = WinAPIUtil.GetCursorPos();
            GenericStage     stage = e.Game.Stage as GenericStage;

            if (stage != null)
            {
                stage.NextUserPosition = new Vector2D(
                    this.GetXWithAspect(pt.x - this.Left),
                    stage.Position.Y + this.GetYWithAspect(pt.y - (this.Top + 20)));
            }
        }
예제 #2
0
        public override void CheckMainInputs()
        {
            base.CheckMainInputs();

            if (WinAPIUtil.GetKeyState(13) != startStage)
            {
                this.State = StageState.Finished;
            }
            if (WinAPIUtil.GetKeyState(27) < 0)
            {
                this.State = StageState.ExitGame;
                brushDraw  = Brushes.Coral;
            }
        }
예제 #3
0
        public virtual void CheckMainInputs()
        {
            /*if (WinAPIUtil.GetKeyState(69) < 0)
             *      this.IsRunning = false;*/

            short currentPauseStatus = WinAPIUtil.GetKeyState(80);

            if (currentPauseStatus < 0)
            {
                currentPauseStatus = lastPauseStatus == 0 ? (short)1 : (short)0;
            }
            if (lastPauseStatus != currentPauseStatus)
            {
                if (this.IsPaused)
                {
                    this.State = StageState.Running;
                }
                else
                {
                    this.State = StageState.Pause;
                }
            }
            lastPauseStatus = currentPauseStatus;
        }