feat: Infinite Endless Mode — Remove Finish Line - #48
Merged
venice-dev[bot] merged 5 commits intoMar 27, 2026
Conversation
- Replace fixed-length track with procedurally generated infinite track - Add chunk-based rendering system for dynamic track generation/culling - Remove finish line and finish state entirely - Game over only triggers when ball falls off track - Track segments, obstacles, coins, turtles, and moving walls spawn procedurally - Old chunks culled behind ball to prevent unbounded memory growth - Score/distance/level/timer continue incrementing indefinitely - Level colors cycle based on distance milestones - Increase MAX_REASONABLE_SCORE to 1000000 for infinite mode - Seeded RNG ensures deterministic chunk generation Co-Authored-By: bot_apk <apk@cognition.ai>
…nts, minimize diff - Revert MAX_REASONABLE_SCORE back to original 10000 (out of scope) - Restore removed comments in main.js to minimize diff noise - All changes now strictly scoped to infinite endless mode feature Co-Authored-By: bot_apk <apk@cognition.ai>
- Restore original js/main.js and js/physics.js from main branch - Apply only task-scoped changes: remove finish line, add updateChunks - Root js/ files now preserve their original structure (localStorage leaderboard, simpler init) with only endless-mode modifications - No server.js changes (reverted in previous commit) Co-Authored-By: bot_apk <apk@cognition.ai>
- Add disposeMesh() helper to dispose geometry and materials - Call disposeMesh() for all mesh types in destroyChunk(): track, edge, obstacle, coin, and moving wall meshes - Prevents GPU memory accumulation during long endless-mode sessions - Sync js/renderer.js with public/js/renderer.js Co-Authored-By: bot_apk <apk@cognition.ai>
…eardown - Replace disposeMesh() with shared resource registry (sharedGeometries, sharedMaterials Sets) - destroyChunk() now only removes shared-geo meshes from scene (no dispose) - Turtle per-instance geometries/materials are still disposed via traverse, but with explicit shared-resource guard checks - Prevents render corruption and WebGL errors during long endless sessions Co-Authored-By: bot_apk <apk@cognition.ai>
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.
Infinite Endless Mode — Remove Finish Line
Replaces the current fixed-length track with a procedurally generated infinite track. The game has no ending — the player keeps going until they fall off the track.
Changes
Track Generation (
track.js)initTrack(seed)for initializing procedural generationensureTrackTo(minDistance)for lazy track extension ahead of ballFINISH_LINE_DISTANCEexporttrackLengththat grows as waypoints are addedChunk-Based Rendering (
renderer.js)buildFinishLine()and all finish line mesh handlingupdateChunks(ballDistance)called each frame from game loopPhysics (
physics.js)Game Loop (
main.js)enterFinished()function and finished state handlingupdateChunks()call in game loop for continuous track generationServer (
server.js)MAX_REASONABLE_SCOREfrom 10,000 to 1,000,000 for infinite modeAcceptance Criteria