Files
Papay-Shooter/debug/jet_vfx_test.gd
2026-08-09 01:31:44 -04:00

43 lines
1.2 KiB
GDScript

extends SceneTree
var _failures: Array[String] = []
func _initialize() -> void:
call_deferred("_run")
func _expect(condition: bool, message: String) -> void:
if not condition:
_failures.append(message)
func _run() -> void:
var host := Node3D.new()
root.add_child(host)
var jets := PlayerJetVFX.new()
host.add_child(jets)
await process_frame
_expect(jets.get_flame_count() == 4, "jet rig must contain exactly four flames")
jets.burst_double_jump()
jets._process(0.016)
var up_exhaust := jets.get_exhaust_direction()
_expect(up_exhaust.y < -0.95, "double-jump exhaust must point mostly down")
_expect(up_exhaust.z > 0.0, "double-jump exhaust needs a slight rear cant")
_expect(jets.visible, "double-jump burst must reveal the flames")
jets.set_dash(true, Vector2(0.0, 1.0))
jets._process(0.016)
var dash_exhaust := jets.get_exhaust_direction()
_expect(dash_exhaust.z > 0.90, "forward dash exhaust must point backward")
_expect(dash_exhaust.y < 0.0, "dash exhaust keeps a slight downward cant")
if _failures.is_empty():
print("JET_POSE_TEST PASS: four flames and directional thrust")
quit(0)
else:
for failure in _failures:
push_error("JET_POSE_TEST FAIL: " + failure)
quit(1)