Conversation
Groundwork for a self-contained games collection under public/games/: - engine/core.js: math/easing helpers, seeded RNG, localStorage-backed shared settings, DPR-aware letterboxed canvas, fixed-step (1/120s) simulation loop with spiral-of-death guard, and a scene stack that supports transparent overlay scenes for pause/dialogs. - engine/input.js: named-action bindings over keyboard, pointer, gamepad and on-screen touch controls (virtual stick + buttons), so gameplay code never touches raw key codes. No build step and no runtime dependencies; both files are plain scripts that work when served statically or opened directly. Parked here pending an architecture decision on whether the games are built on this hand-rolled base or on an external stack (Pixi/three + Rapier + Howler), which would replace most of the engine layer. Co-Authored-By: Claude <noreply@anthropic.com>
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.
Groundwork for a self-contained games collection under
public/games/. Two plain scripts, no build step, no runtime dependencies — they work served statically by the existing Expresspublic/middleware or opened directly from disk.What's here
public/games/engine/core.js(211 LOC) — math/easing helpers, seeded RNG,localStorage-backed settings shared across games, DPR-aware letterboxed canvas scaling, a fixed-step (1/120s) simulation loop with a spiral-of-death guard, and a scene stack with transparent overlay scenes for pause/dialog screens.public/games/engine/input.js(180 LOC) — named-action bindings layered over keyboard, pointer, gamepad and on-screen touch controls (virtual stick + buttons), so gameplay code never touches raw key codes.Status
Draft, and deliberately parked. This is the hand-rolled branch of an open architecture decision: build the games on this base, or on an external stack (Pixi/three + Rapier + Howler) that would replace most of this engine layer with imports.
The trade-off in short: the hand-rolled path costs ~1000 LOC of engine before any gameplay and caps out at stylized 2D, but ships ~60KB with zero deps and no build. The library path frees the whole budget for gameplay and raises the fidelity ceiling (3D, skeletal animation, real physics), at the cost of ~1–2MB of runtime and a build step this repo does not currently have.
Nothing downstream depends on these files yet, so they are safe to drop wholesale if the decision goes the other way.
Generated by Claude Code