Overview
Snake began as a terminal game and evolved into a browser-focused WebAssembly project intended for inclusion in a static engineering portfolio. The platform-independent engine owns movement, growth, scoring, collision handling, direction safety, and configurable difficulty modes, while browser-specific modules handle animation, input, and rendering. The frontend uses requestAnimationFrame with a fixed-timestep accumulator, HTML Canvas graphics, keyboard and touch controls, pause and focus handling, and a pre-game countdown. Release tooling embeds the source commit into the WASM build, emits a provenance manifest, supports iframe-based portfolio integration, and verifies native and WASM targets in GitHub Actions.
Engineering Highlights
- Separates platform-independent game rules from WASM-only browser and Canvas modules
- Combines requestAnimationFrame rendering with a fixed-step simulation accumulator
- Supports keyboard, touch, responsive layouts, difficulty presets, custom arenas, and focus-aware pausing
- Embeds the source commit in release builds and emits a manifest for artifact provenance
- Tests core movement and collision behavior while linting native and WASM targets in CI