feat(snake): integrate EduPlay educational-question SDK at game-over#392
Open
lloydho wants to merge 1 commit into
Open
feat(snake): integrate EduPlay educational-question SDK at game-over#392lloydho wants to merge 1 commit into
lloydho wants to merge 1 commit into
Conversation
Replaces the bare scene.start('MainMenuScene') on snake-death with an
EduPlay educational-question break (Duolingo-style question instead of
an ad at the natural game-over pause).
- src/games/snake/src/eduplay.ts (NEW): EduPlay client init + showAdBreak
helper, mock mode for evaluation (no real placement ID required).
- src/games/snake/src/game.ts: side-effect import of eduplay.ts.
- src/games/snake/src/scenes/game-scene.ts: showAdBreak({ onResume })
at the death branch in update(), guarded by adBreakTriggered flag.
Mock mode means no live API call — replace 'mock: true' and the
placeholder placement ID with values from https://app.eduplay.com to
ship for real.
The @eduplay/sdk-web and @eduplay/sdk-core deps are wired via local
file: links because the packages are not yet on npm (Phase-1 EduPlay
launch is in progress). The package.json `file:` paths are honest about
the build provenance; once the packages are published these become
semver ranges. Build-verified locally with `yarn run build-prod` (exit
0, +10.3 KiB bundle delta over pristine).
Filed as part of EduPlay's Track J evaluation port. See
lloydho/eduplay#59 for the parent task.
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.
Replaces the bare
scene.start('MainMenuScene')on snake-death with an EduPlay question break.EduPlay shows a Duolingo-style educational question instead of a rewarded ad at natural pause points. Game developers integrate the SDK; parents subscribe and fund developer payouts.
What this PR does
@eduplay/sdk-web(+ its peer@eduplay/sdk-core) as deps insrc/games/snake/.src/games/snake/src/eduplay.ts).showAdBreak({ onResume })— when the ad dismisses (answer submitted), the game returns to the main menu just like before.Mock mode for evaluation
The integration uses
mock: true+ a placeholder placement ID (pl_mock00000000000000000000). The hosted/breakpage serves bundled canned questions; no API call is made. To ship for real, replace those values with output fromhttps://app.eduplay.com.A note on dependency paths
@eduplay/sdk-weband@eduplay/sdk-coreare not yet on the npm registry (EduPlay's Phase-1 launch is in progress). The committedpackage.jsondeclares them with localfile:paths because that's how the build was actually verified. Once published, these become semver ranges. Anyone reproducing the build today needs the EduPlay monorepo checked out at the path encoded inpackage.json— please flag if this is a blocker and we'll publish to npm sooner.Build verification
cd src/games/snake && yarn install && yarn run build-prodexits 0.Acceptance for upstream
This PR is filed as evidence for EduPlay's Track J evaluation (validating SDK ergonomics on a real OSS Phaser 3 game). Upstream-acceptance is not required for the evaluation to succeed — happy to close if it doesn't fit the repo's direction.
Filed against eduplay's parent: https://github.com/lloydho/eduplay/issues/59