Restrict speed boost to space

This commit is contained in:
Loïc Wisniewski 2026-09-03 23:14:02 +02:00
commit 2ecd61de98
5 changed files with 24 additions and 60 deletions

View file

@ -6,6 +6,7 @@ extends SceneTree
const DASH_COST: int = 15
const DASH_DISTANCE: float = 520.0
const DASH_SETTLE_TIME: float = 0.3
var state: Node
var main: Node
@ -71,7 +72,7 @@ func _process(delta: float) -> bool:
elapsed = 0.0
return false
1:
if elapsed < 0.7:
if elapsed < DASH_SETTLE_TIME:
return false
var moved: Vector2 = fleet.get_centroid() - first_origin
if absf(moved.x - DASH_DISTANCE) > 8.0 or absf(moved.y) > 8.0:
@ -92,7 +93,7 @@ func _process(delta: float) -> bool:
elapsed = 0.0
return false
2:
if elapsed < 0.7:
if elapsed < DASH_SETTLE_TIME:
return false
var moved: Vector2 = fleet.get_centroid() - second_origin
if absf(moved.y + DASH_DISTANCE) > 8.0 or absf(moved.x) > 8.0:
@ -104,6 +105,8 @@ func _process(delta: float) -> bool:
var surface: Node = load("res://surface/PlanetSurface.tscn").instantiate()
if not surface.has_node("DashController") or not surface.has_node("UI/DashButton"):
return _fail("planet surface does not carry the dash ability")
if surface.has_node("UI/SpeedFader"):
return _fail("planet surface still carries the sustained speed multiplier")
surface.free()
print("two aimed dashes moved %.0f units, preserved formation, and cooled down per Propulser" \
% DASH_DISTANCE)