chore: run gdformat

This commit is contained in:
2025-08-20 04:47:49 +02:00
parent 702080af59
commit c7c4eb574e
12 changed files with 47 additions and 13 deletions

View File

@@ -7,13 +7,15 @@ extends Node2D
var player: Player
func _ready() -> void:
player = get_tree().get_first_node_in_group(GlobalConst.GROUP_PLAYER)
func _physics_process(delta: float) -> void:
if not player:
return
var to_player = player.global_position - global_position
var dist = to_player.length()
var attract_radius = player.player_stats.get_final("pickup_radius", player.modifiers)
@@ -23,5 +25,7 @@ func _physics_process(delta: float) -> void:
return
if dist < attract_radius:
var dir = to_player.normalized()
var speed = lerp(adjusted_min_speed, adjusted_max_speed, (attract_radius - dist) / attract_radius)
var speed = lerp(
adjusted_min_speed, adjusted_max_speed, (attract_radius - dist) / attract_radius
)
global_position += dir * speed * delta