Improve nearby water recovery and camera prompts
Recover players on generated worlds to the nearest safe grass or sand surface. Use the active gameplay camera when positioning shop and storage prompts.
This commit is contained in:
parent
ae802493a0
commit
4575830857
10 changed files with 396 additions and 25 deletions
18
main/main.gd
18
main/main.gd
|
|
@ -1006,7 +1006,8 @@ func _initialize_application(dedicated: bool) -> void:
|
|||
_game_ui,
|
||||
_game_ui.get_screen_fade(),
|
||||
_test_world.get_player_water_triggers(),
|
||||
_test_world.get_safe_respawn_points()
|
||||
_test_world.get_safe_respawn_points(),
|
||||
Callable(_test_world, "get_water_recovery_position"),
|
||||
)
|
||||
_ui_pixelation.effective_pixel_size_changed.connect(
|
||||
_on_effective_ui_pixel_size_changed
|
||||
|
|
@ -2344,17 +2345,9 @@ func _on_remote_recovery_requested(
|
|||
peer_id,
|
||||
"Fishing attempt ended."
|
||||
)
|
||||
var target_position: Vector3 = _test_world.get_player_spawn_transform().origin
|
||||
var nearest_distance: float = INF
|
||||
for point: SafeRespawnPoint in _test_world.get_safe_respawn_points():
|
||||
if point == null or not point.enabled:
|
||||
continue
|
||||
var distance: float = point.get_horizontal_distance_squared(
|
||||
entry_position
|
||||
)
|
||||
if distance < nearest_distance:
|
||||
nearest_distance = distance
|
||||
target_position = point.global_position
|
||||
var target_position := _test_world.get_water_recovery_position(
|
||||
entry_position
|
||||
)
|
||||
target_position.y += _water_recovery.respawn_height_offset
|
||||
avatar.global_position = target_position
|
||||
avatar.velocity = Vector3.ZERO
|
||||
|
|
@ -2432,6 +2425,7 @@ func _apply_world(
|
|||
spawn_transform,
|
||||
_test_world.get_player_water_triggers(),
|
||||
_test_world.get_safe_respawn_points(),
|
||||
Callable(_test_world, "get_water_recovery_position"),
|
||||
)
|
||||
_shoreline_ambience.configure(
|
||||
_player,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue