Polish dialog and intro transitions

This commit is contained in:
Loïc Wisniewski 2026-09-02 20:18:44 +02:00
commit d413d1da9f
7 changed files with 228 additions and 4 deletions

View file

@ -35,6 +35,8 @@ extends SceneTree
# R. #139 - no belt rock is laid down inside the visible screen
# S. #170 - the prologue opens on the PICTURE: the convoy is flying and the
# game is running for a few seconds before the guide says anything
# T. #183 - absorption whites out the full screen, teleports only once the
# cover is opaque, then reveals the fleet at the normal spawn
var game_state: Node
var scene: Node
@ -45,6 +47,7 @@ var stage: int = 0
var elapsed: float = 0.0
var convoy_size: int = 0
var skipped_props: Array = []
var whiteout_mid_checked: bool = false
func _initialize() -> void:
@ -367,6 +370,14 @@ func _process(delta: float) -> bool:
# --- H. the vortex --------------------------------------
director._begin(director.Beat.VORTEX)
var fade: ColorRect = scene.get_node("FadeOverlay/FadeRect")
var viewport_size: Vector2 = scene.get_viewport().get_visible_rect().size
if fade.size.distance_to(viewport_size) > 1.0:
return _fail("whiteout is %s, viewport is %s" % [fade.size, viewport_size])
if fade.color.r < 0.99 or fade.color.g < 0.99 or fade.color.b < 0.99:
return _fail("the vortex transition is not white")
if fade.color.a > 0.01:
return _fail("the whiteout began fully opaque instead of fading in")
elapsed = 0.0
stage = 3
return false
@ -374,6 +385,15 @@ func _process(delta: float) -> bool:
# Left to the director's own clock rather than ticked by hand:
# the vortex is a timed animation and driving it twice would not
# be the thing that ships.
if not whiteout_mid_checked and elapsed >= director.WHITEOUT_IN_SECONDS * 0.5:
whiteout_mid_checked = true
var mid_fade: ColorRect = scene.get_node("FadeOverlay/FadeRect")
if mid_fade.color.a <= 0.05 or mid_fade.color.a >= 0.95:
return _fail("whiteout did not gradually fade in (alpha %.2f)" % mid_fade.color.a)
if director.whiteout_teleported:
return _fail("fleet teleported before the screen was fully white")
if fleet.get_formation_origin().distance_to(director.DEFAULT_SPAWN) <= 1.0:
return _fail("fleet reached default spawn before full white")
if elapsed < 4.2:
return false
var alive: int = 0
@ -386,6 +406,15 @@ func _process(delta: float) -> bool:
return _fail("the survivor is a %s, not the default interceptor" \
% fleet.ships[0].vessel_type)
print("the vortex took %d vessels and left one interceptor" % (convoy_size - 1))
if not director.whiteout_teleported:
return _fail("the screen reached white without teleporting the fleet")
if fleet.get_formation_origin().distance_to(director.DEFAULT_SPAWN) > 1.0:
return _fail("whiteout revealed the fleet at %s instead of default spawn %s" \
% [fleet.get_formation_origin(), director.DEFAULT_SPAWN])
var revealing: ColorRect = scene.get_node("FadeOverlay/FadeRect")
if revealing.color.a >= 0.99:
return _fail("screen stayed fully white after teleport")
print("whiteout hid the teleport to default spawn, then began revealing it")
# --- I. the handover ------------------------------------
director.finish()
@ -426,6 +455,9 @@ func _process(delta: float) -> bool:
return _fail("the breach lens is still over the screen after the handover")
if is_instance_valid(director) and director.breach != null:
return _fail("the black hole outlived the prologue")
var finished_fade: ColorRect = scene.get_node("FadeOverlay/FadeRect")
if finished_fade.color.a > 0.001 or finished_fade.color.r > 0.001:
return _fail("intro left the shared fade overlay tinted white")
print("handover: flags clear, 1 interceptor, waves and rocks running, buttons back")
_drop_scene()
elapsed = 0.0