Files
urm03/scripts/arena.gd
T
vh 380088c694 feat: tracer bullet — greybox arena, positioning piloting, auto-fire KINETIC weapon
One-screen 640x360 arena (walls, grid floor, fixed view), mech with
positioning-only movement (WASD/arrows, accel/decel, no aim), auto-fire
KINETIC hardpoint (nearest-target, visible range ring) firing slugs
that damage + knock back, untagged grunt trickle spawner with contact
damage, hull bar HUD, scene-reload on hull zero.

Headless smoke gate: tests/smoke.tscn asserts boot, piloting movement,
spawning, input-free auto-fire, grunt lethality, knockback displacement.
3/3 passes on nh3-dev headless 4.7.1.
2026-08-06 22:21:10 -07:00

32 lines
972 B
GDScript

extends Node2D
## One greybox arena, one screen (640x360), fixed camera. Draws its own
## floor and wall slabs; tracks kills for instrumentation.
var kills: int = 0
func _ready() -> void:
$Spawner.grunt_spawned.connect(_on_grunt_spawned)
$Mech.hull_changed.connect(_on_hull_changed)
func _on_grunt_spawned(grunt: Node) -> void:
grunt.died.connect(func() -> void: kills += 1)
func _on_hull_changed(hull: float, hull_max: float) -> void:
$HUD/HullFill.size.x = 118.0 * (hull / hull_max)
func _draw() -> void:
draw_rect(Rect2(0, 0, 640, 360), Color(0.1, 0.11, 0.13))
for x in range(0, 641, 32):
draw_line(Vector2(x, 0), Vector2(x, 360), Color(0.13, 0.145, 0.17))
for y in range(0, 361, 32):
draw_line(Vector2(0, y), Vector2(640, y), Color(0.13, 0.145, 0.17))
var wall := Color(0.3, 0.32, 0.36)
draw_rect(Rect2(0, 0, 640, 16), wall)
draw_rect(Rect2(0, 344, 640, 16), wall)
draw_rect(Rect2(0, 0, 16, 360), wall)
draw_rect(Rect2(624, 0, 16, 360), wall)