feat: ecology as gameplay content layer - #7
Open
aliciapaz wants to merge 6 commits into
Open
Conversation
Wire clean dung to raise soil health and pesticide-contaminated dung to lower it via the soil-health module; a run ends when the ecosystem collapses. Rename toxic dung to pesticide dung throughout. GameOver now reports soil health restored.
Enqueue a note the first time the player recycles clean dung, hits pesticide dung, or meets a frog; flush the queue to the GameOver screen so notes never interrupt a run.
Reachable from the title menu; carries placeholder mission copy pending the pledge effort (R11).
- help.js referenced the removed 'toxicDung' texture key; use 'pesticideDung' - game.js update() could call scene.start and the destructive flushNotes on repeated frames, delivering an empty notes array to GameOver; guard so the transition and flush happen exactly once - rename gameOver's scoreText field to soilHealthText - strengthen soil-health and note-queue tests: value-pin deltas, cover the partial-drain-to-floor case, and pin that dedupe survives a flush
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.
Context
Beetle Rush is being turned into a pay-once, ad-free mobile game whose proceeds fund agroecology and ecological restoration research, designed to be fun rather than addictive. A generic endless runner has no path to buyers under that model; the durable edge is what the game is about. This change makes the ecology the game itself instead of flavor: the score stops being an arbitrary number and becomes the real reason dung beetles matter.
Implements idea 3 ("the mission is the product") from the ideation, per the requirements in
docs/brainstorms/2026-07-18-ecology-as-gameplay-requirements.mdand the plan indocs/plans/2026-07-19-001-feat-ecology-as-gameplay-plan.md.What Changed
src/config/soilHealth.js,src/objects/noteQueue.js,src/config/ecologyNotes.js.Notable decisions: soil health is per-run only (no cross-run persistence, keeping it a grind-free arcade game); the score and player-health systems are merged into one meaningful meter; new predators (birds, toads) are deferred because they need art.
How to Test
npm install(needs thecairo/pangocairosystem libraries for thecanvasdependency), thennpm test— 14 unit tests should pass (soil-health,note-queue).npx eslint srcshould be clean.npm startand play a run:Note: the Phaser scene layer was not runtime-verified in CI here because the
canvasnative dependency could not build (missing system libs). The extracted logic is unit-tested; the in-game wiring should get one manual playthrough before release.Deployment Tasks
None.
Known follow-ups (not in this PR)