Eine weitere Strecke hinzufügen#1
Open
SebastianSchoeps wants to merge 1 commit into
Open
Conversation
Add a new S-shaped switchback track with wide 6-cell corridors and gentle hairpin turns, designed to be easier than Monaco for beginners. Co-Authored-By: Claude Opus 4.6 <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.
Summary
Implements the feature request from Trello card.
Trello Card
https://trello.com/c/dzX6lcgF/1-eine-weitere-strecke-hinzuf%C3%BCgen
Implementation Plan (v6)
Click to expand
Summary
Add a new beginner-friendly hairpin/switchback track called "Serpentine" to the paper-racing game, featuring a winding S-curve layout that is easier than Monaco.
Implementation Plan
All changes are in a single file:
index.htmlStep 1: Add the new track to the
TRACKSregistryAt
index.html:152, add a new entry to theTRACKSobject:Grid size of 40x30 is slightly smaller than Monaco (48x34) to keep it simpler. The name "Serpentine" describes the S-shaped switchback layout.
Step 2: Implement the
buildSerpentine()functionAdd a new function after
buildMonaco()(after line 312). The track design is a series of wide horizontal straights connected by U-turns (hairpin switchbacks), creating an S-shaped path flowing top-to-bottom-to-top:Key design decisions for beginner-friendliness:
The build function will:
makeGrid(){ grid, start, finish, dir: { x: 1, y: 0 } }(moving right)Step 3: Add the track option to the HTML dropdown
At
index.html:122, add a new<option>to the track picker<select>:Files to Modify/Create
index.html:149-153serpentineentry toTRACKSobjectindex.html:~313(afterbuildMonaco)buildSerpentine()function (~45 lines)index.html:119-123<option value="serpentine">Serpentine</option>to track pickerNo new files need to be created — all changes are within the single
index.html.Risks and Dependencies
Track playability: The hairpin turn geometry must be validated to ensure the car can actually navigate the switchbacks without getting stuck. The turns need to be wide enough (at least 5-6 cells) that a car with reasonable velocity can decelerate and change direction. This will need manual playtesting after implementation.
Canvas scaling: The 40x30 grid at 24px per cell = 960x720px, which is within the existing scaling logic. No changes needed to the rendering system.
Finish line crossing detection: The existing lap detection logic using
trackDirand dot-product direction checking works generically. As long as the start/finish cells anddirvector are correctly set for the new track, it will work without modification.No other code changes needed: The entire game engine (rendering, movement validation, input handling, undo, HUD) is track-agnostic — it operates on the grid/start/finish/dir data returned by any build function.
This pull request was automatically generated by Solvy AI.