chore: run gdformat
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user