Пример #1
0
        public static ValueTask Update(CanvasTimingInformation info, IHumanInterfaceParser input)
        {
            TotalTime = info.TotalTime;

            if (info.TotalTime - _lastTimeKeyboardChecked > .25f.Seconds())
            {
                _lastTimeKeyboardChecked = info.TotalTime;

                if (input.IsKeyCurrentlyDown(Keys.D))
                {
                    ShouldShow = !ShouldShow;
                }
            }

            if (input.WasKeyPressedAndReleased(Keys.A))
            {
                Constants.FramesPerSecond -= 5;
                Constants.FramesPerSecond  = Math.Max(5, Constants.FramesPerSecond);
            }

            if (input.WasKeyPressedAndReleased(Keys.S))
            {
                Constants.FramesPerSecond += 5;
            }

            return(default);
Пример #2
0
        async ValueTask checkCheatKeys()
        {
            if (Cheats.AllowDebugKeys && _input.IsKeyCurrentlyDown(Keys.Three))
            {
                // ReSharper disable once HeapView.BoxingAllocation
                _currentAct = await _mediator.Send(new GetActRequest("LevelFinishedAct"));
            }
            if (Cheats.AllowDebugKeys && _input.IsKeyCurrentlyDown(Keys.Four))
            {
                await _mediator.Publish(new PacManEatenEvent());
            }

            if (Cheats.AllowDebugKeys && _input.WasKeyPressedAndReleased(Keys.Six))
            {
                await _mediator.Publish(new AllPillsEatenEvent());
            }
        }