ShitboxInfinity/levels/woolies_carpark/carpark.gd
type-two 1c0b7efb32 Engine v0: Godot 4.6 data-driven arcade racer scaffold
Drop-in content: cars/<id>/stats.tres (+optional car.glb), levels/<id>/level.glb
or .tscn with a Spawn marker. Raycast arcade car (boost, drift, drift-earns-boost),
chase cam, HUD, menu built from registry scan. Placeholder Woolies carpark with
shuntable parked cars. Headless smoke test + windowed screenshot harness.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-27 21:03:45 +10:00

40 lines
1.4 KiB
GDScript

extends Node3D
## ponytail: placeholder carpark built in code -- real levels arrive as level.glb from Blender
## and this whole folder becomes just the GLB + nothing else.
func _ready() -> void:
var rng := RandomNumberGenerator.new()
rng.seed = 8
_box(Vector3(0, -0.5, 0), Vector3(240, 1, 160), Color(0.35, 0.35, 0.37)) # tarmac
for side in [-1, 1]: # kerb walls
_box(Vector3(0, 0.4, side * 79.0), Vector3(240, 0.8, 2), Color(0.6, 0.6, 0.6))
_box(Vector3(side * 119.0, 0.4, 0), Vector3(2, 0.8, 160), Color(0.6, 0.6, 0.6))
for row in 4: # rows of parked shitboxes, shuntable
for bay in 10:
if rng.randf() < 0.35:
continue
var pos := Vector3(-27.0 + bay * 6.0, 0.8, -30.0 + row * 18.0)
_box(pos, Vector3(1.9, 1.4, 4.4), Color.from_hsv(rng.randf(), 0.5, rng.randf_range(0.4, 0.9)), true)
for i in 6: # light poles
_box(Vector3(-30.0 + i * 12.0, 3.0, 8.0), Vector3(0.4, 6.0, 0.4), Color(0.3, 0.3, 0.3))
func _box(pos: Vector3, size: Vector3, color: Color, dynamic := false) -> void:
var body: PhysicsBody3D = RigidBody3D.new() if dynamic else StaticBody3D.new()
if dynamic:
body.mass = 300.0
var shape := CollisionShape3D.new()
var bs := BoxShape3D.new()
bs.size = size
shape.shape = bs
var mi := MeshInstance3D.new()
var bm := BoxMesh.new()
bm.size = size
var mat := StandardMaterial3D.new()
mat.albedo_color = color
bm.material = mat
mi.mesh = bm
body.add_child(shape)
body.add_child(mi)
body.position = pos
add_child(body)