Port of the Kenney "Starter Kit Racing" Godot 4.6 project to plain JavaScript and three.js with crashcat physics.
js/— JavaScript portmain.js— Entry point, scene setup, game loopPhysics.js— crashcat wall colliders and sphere body (ported from Godot collision shapes)Track.js— GridMap track layout and piece placementVehicle.js— Vehicle physics and controlsCamera.js— Camera systemControls.js— Input handlingParticles.js— Smoke trail effectsAudio.js— Sound
models/— GLB models shared between both versionsaudio/— Audio assetssprites/— Sprite assets
- GridMap cell size: 9.99 units, scale: 0.75 (
CELL_RAWandGRID_SCALEinTrack.js) - Track group has
position.y = -0.5offset - Godot vehicle models use
root_scale = 0.5 - Wall colliders: friction 0.0, restitution 0.1
- Corner colliders: arc center at
(-CELL_HALF, +CELL_HALF)in local space, outer wall radius2*CELL_HALF - 0.25 - Orientation mapping from Godot GridMap indices:
{ 0: 0°, 10: 180°, 16: 90°, 22: 270° }
Godot collision shapes are defined in _godot/models/Library/mesh-library.tscn as ConcavePolygonShape3D vertex data. The JS port approximates these with crashcat cuboid colliders.