feat(demo): add kiosk idle-detection and How-to-Play tutorial demo mode#2978
Open
macan88 wants to merge 3 commits intoFreezingMoon:masterfrom
Open
feat(demo): add kiosk idle-detection and How-to-Play tutorial demo mode#2978macan88 wants to merge 3 commits intoFreezingMoon:masterfrom
macan88 wants to merge 3 commits intoFreezingMoon:masterfrom
Conversation
|
@macan88 is attempting to deploy a commit to the FreezingMoon Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When AncientBeast runs in kiosk / attract mode with no active players, the screen simply waits with no visual feedback, missing an opportunity to onboard new players and keep the display engaging (issue #2976, related #933).
Solution
Introduces a
DemoModeclass (src/demo/DemoMode.ts) that:setTimeout; anypointermove,pointerdown, orkeydownevent resets the countdown while the game is idle.notifyMeaningfulActivity()so the game board can reset the timer only on real game actions (creature moves, ability use) rather than passive camera pans.HOW_TO_PLAY_STEPSarray (5 slides, 8 s each) viagame.onDemoStep()callbacks; easy to extend without touching engine code.pointerdownorkeydowncallsgame.onDemoCancel()synchronously, guaranteeing no residual game state.enable()/disable()ensure the demo timer is never armed during a live match.DemoSequenceType.AI_BATTLEandHISTORIC_REPLAYare declared and routed through the sequence picker; they return empty step arrays today and will be filled once the state-machine PR merges.Integration (game.ts)
Add three hook methods to
Game:Then in the kiosk entry point:
And on meaningful board actions:
Testing
src/demo/DemoMode.test.tswith four focused Jest tests using fake timers:enable()was not called (non-kiosk guard)notifyMeaningfulActivity()correctly resets the idle countdownCloses #2976