Conversation
Scatter glowing pickups around the map; driving through one grants a temporary top-speed multiplier for the vehicle.
Review: Speed Boost PickupsGreat feature! The gameplay logic is solid. However, there's a bug in the canvas drawing that needs fixing before merge. Critical Issue: Arc Angle ParametersIn The canvas Lines to fix:
Good Implementation Notes✅ Boost timer correctly decrements by dt each frame Fix the arc angles and this is ready to merge! |
pbardocz
left a comment
There was a problem hiding this comment.
Additional review notes
Confirmed the arc-angle issue already flagged in the comment above (7 vs Math.PI * 2 at index.html:1363/1367) — agreed, that should be fixed before merge.
A few more things worth a look:
-
Boost only decays while driving.
player.boost -= dtlives insidedriveVehicle()(index.html:1057), butcheckBoosts()runs every frame regardless of whether the player is on foot or in a car (index.html:1547). Walking over a pickup setsplayer.boost = 240and it just sits there — undecayed — until the player next gets in a vehicle, however long that takes. Is a "banked" boost the intended design, or should the timer start counting down from the moment of pickup regardless of vehicle state? -
Reverse speed also gets boosted.
topSpeedmultiplies both the forward clamp and the reverse clamp (-topSpeed * 0.42, index.html:1036), so boost pickups make reversing 1.6x faster too. Probably harmless, but worth confirming it's intentional. -
No feedback once the toast fades. The "Speed boost!" toast lasts 170 ticks (
toast(), index.html:961) but the boost itself lasts 240 ticks (BOOST_DURATION), so there's a ~70-tick window where the player still has the speed boost but no on-screen indication of it. A small always-on indicator (HUD icon, vehicle glow, etc.) whileplayer.boost > 0would close that gap. -
No test coverage. Per CLAUDE.md this repo's only test is a static check on
index.html's script (tests/test_render_mini.py) — it still passes here, but nothing exercises the new pickup/decay/multiplier logic even at the level this repo's test style allows (e.g. a static check thatcheckBoosts()is called from the main loop, mirroring the existingrenderMiniliveness check). -
Nit:
drawBoost()isn't culled by thevis()viewport check the other entities use before drawing (index.html:1402-ish) — trivial with only 5 pickups on the map, but worth keeping in mind if the pickup count ever grows.
Otherwise the core mechanic (spawn → pickup → toast → respawn, multiplier clamp) looks correct and matches the PR description.
Summary
Add collectible speed boost pickups scattered around the map that give the player's vehicle a temporary top-speed multiplier.
Changes
boostsarray of pickup locations, spawned along roads via the existingroadPoint()helpercheckBoosts()to detect pickup and grantplayer.boostdurationdriveVehicle()while a boost is active, decrementing the timer each frameTesting
index.htmlin a browser