extends SceneTree func _initialize() -> void: call_deferred("run_test") func run_test() -> void: var world = load("res://scenes/main.tscn").instantiate() root.add_child(world) world.player.hp = 100000 Input.mouse_mode = Input.MOUSE_MODE_VISIBLE await create_timer(5.2).timeout assert(world.wave == 1 and world.alive == 6 and not world.spawning) for zombie in get_nodes_in_group("live_zombies"): zombie.take_damage(1000, zombie.global_position.y + 0.9) assert(world.alive == 0 and world.wave_pending) world._check_wave() world._check_wave() # no duplicate next-wave scheduling await create_timer(3.2).timeout assert(world.wave == 2) await create_timer(6.4).timeout assert(world.wave == 2 and world.alive == 8 and not world.spawning) assert(get_nodes_in_group("zombie_corpses").size() == 6) print("PASS: wave1=6, clear -> wave2=8, single transition, corpses retained") world.queue_free() await process_frame quit()