Smooth boosted fleet travel
This commit is contained in:
parent
e5439f7183
commit
fd792e8b63
12 changed files with 90 additions and 8 deletions
|
|
@ -230,6 +230,7 @@ func teleport_to(world_pos: Vector2) -> void:
|
|||
ship.move_target += displacement
|
||||
ship.velocity = Vector2.ZERO
|
||||
ship.fleet_velocity = Vector2.ZERO
|
||||
ship.reset_physics_interpolation()
|
||||
steer_direction = Vector2.ZERO
|
||||
dash_remaining = 0.0
|
||||
dash_direction = Vector2.ZERO
|
||||
|
|
@ -242,7 +243,7 @@ func teleport_to(world_pos: Vector2) -> void:
|
|||
|
||||
|
||||
func move_in_direction(direction: Vector2) -> void:
|
||||
# Joystick steering. Sets the heading; _process advances the anchor.
|
||||
# Joystick steering. Sets the heading; _physics_process advances the anchor.
|
||||
#
|
||||
# This used to park a target 2000 units ahead and let the ships chase
|
||||
# it. That made formation changes barely register while flying: with
|
||||
|
|
@ -275,7 +276,13 @@ func is_dashing() -> bool:
|
|||
return dash_remaining > 0.0
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
func is_using_speed_boost() -> bool:
|
||||
return GameState.fleet_speed_multiplier > 1.0 \
|
||||
and steer_direction != Vector2.ZERO and not is_dashing() \
|
||||
and not ships.is_empty()
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
# #158: a building may pay a local cost out of the hold when the fleet is
|
||||
# actually standing at it, and the autoload has no other way to know
|
||||
# where that is. Written before the early return below - a parked fleet
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
radius = 16.0
|
||||
|
||||
[node name="Ship" type="Area2D"]
|
||||
physics_interpolation_mode = 1
|
||||
script = ExtResource("1")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
|
|
|
|||
Loading…
Reference in a new issue