Fix boss planet landing controls

This commit is contained in:
Loïc Wisniewski 2026-09-03 22:21:11 +02:00
commit 471a43e8a6
3 changed files with 12 additions and 21 deletions

View file

@ -14,7 +14,6 @@ extends Node2D
const REVEAL_SECONDS: float = 1.15
const REVEAL_SHAKE: float = 28.0
const APPROACH_STANDOFF: float = 850.0
var reveal_started: bool = false
var reveal_left: float = 0.0
@ -47,22 +46,11 @@ func _ready() -> void:
_set_combat_ui_visible(false)
indicator.visible = true
indicator_label.visible = true
game_state.encounter_locks_movement = true
# The encounter introduces itself in the world: the fleet is drawn toward
# the signal until the Warden reaches the edge of view, then control is
# returned after the roar. No dialog or separate scene hides the approach.
_begin_approach.call_deferred()
# The signal is a destination, not an autopilot order. The player keeps
# control while approaching it; only the short reveal below takes the wheel.
_refresh_status()
func _begin_approach() -> void:
# PlanetSurfaceController composes this encounter before it spawns the
# restored fleet. Waiting one call guarantees there are ships for the
# scripted move to steer.
if not reveal_started and not fleet.ships.is_empty():
fleet.move_to(boss.global_position + Vector2(0.0, APPROACH_STANDOFF))
func _exit_tree() -> void:
if game_state != null:
game_state.encounter_locks_movement = false
@ -95,6 +83,7 @@ func begin_reveal() -> void:
return
reveal_started = true
reveal_left = REVEAL_SECONDS
game_state.encounter_locks_movement = true
fleet.stop()
indicator.visible = false
indicator_label.visible = false