#130, #135: a vessel's death takes a moment, and leaves an interceptor

#130 asked for the hull to break away from the fleet, drift a few metres,
and go up further off with something more explosive than a light animation.

The wreck is a separate node rather than the Ship staying alive to animate,
and that is the load-bearing part. A dying Ship still in the tree is still
an Area2D in the player_ships group with live weapon components - it would
keep firing, keep being fired at, keep counting as a target, and keep
colliding on the way out. So the ship's own lifecycle is untouched: it
leaves the fleet, emits destroyed, and is freed on exactly the frame it
always was. What is left behind is scenery, and the test pins that.

The explosion at the end was also the quieter of the two the game has.
Killing an enemy was made deliberately loud by #87 while losing one of your
own kept the base class's twelve-particle default - the reward louder than
the loss. It is now the bigger of the two.

#135 is the same scene from the other end: the prologue's convoy flies its
escorts on the corners of the box, which is the exposed part of it, and the
debris belt can take all four. With no interceptor left, the only hulls the
vortex could spare were holds, and the player flew out of the prologue in a
carrier. Two guards now: one interceptor is put back into the convoy at the
top of the vortex, where a vessel appearing among ten being thrown around a
black hole is not something anyone will catch; and the handover checks the
TYPES it hands over rather than only the count - one surviving carrier is
also a fleet of one, and it is not the fleet a new game starts with.
This commit is contained in:
Loïc Wisniewski 2026-08-28 15:04:26 +02:00
commit 710dcbf230
8 changed files with 419 additions and 6 deletions

View file

@ -3,9 +3,15 @@ extends SceneTree
# Headless gameplay test: run with
# godot --headless -s res://tests/test_asteroid_ship_collision.gd
# Verifies that a ship touching an asteroid destroys BOTH the ship (removed
# from the fleet) and the asteroid itself (mutual destruction), each
# spawning its own coherent explosion VFX: light-burst blue for the ship,
# debris brown for the asteroid.
# from the fleet) and the asteroid itself (mutual destruction), each leaving
# its own coherent VFX behind.
#
# #130 changed what the ship leaves. Its death is a sequence now - the hull
# breaks away from the fleet, drifts clear, and explodes out there - so what
# exists on the frame of the collision is the WRECK, and the explosion comes
# later, somewhere else. That the wreck really does drift and really does go
# up is test_ship_death's job; what matters here is that the collision still
# ends the ship, ends the rock, and leaves each of them something to look at.
const CHECK_DELAY: float = 0.05
@ -55,7 +61,7 @@ func _check_results() -> void:
var ship_vfx_ok: bool = false
var asteroid_vfx_ok: bool = false
for child in root.get_children():
if child is ShipExplosionVFX:
if child is ShipWreckVFX:
ship_vfx_ok = true
elif child is AsteroidExplosionVFX:
asteroid_vfx_ok = true