2025-09-17 15:10:13 +02:00
|
|
|
extends ActiveItem
|
|
|
|
|
@export var cooldown = 1
|
|
|
|
|
@export var arrow_scene : PackedScene
|
|
|
|
|
|
2025-09-17 16:41:29 +02:00
|
|
|
func collect():
|
|
|
|
|
player.set_cooldown(cooldown)
|
|
|
|
|
return super.collect()
|
|
|
|
|
|
2025-09-17 15:10:13 +02:00
|
|
|
|
|
|
|
|
func activate():
|
2025-09-17 16:41:29 +02:00
|
|
|
player.activate_cooldown()
|
2025-09-17 15:10:13 +02:00
|
|
|
var arrow : Area2D = arrow_scene.instantiate()
|
|
|
|
|
get_tree().get_root().add_child(arrow)
|
|
|
|
|
arrow.position = player.position
|
|
|
|
|
arrow.rotation = player.rotation
|
|
|
|
|
arrow.direction = player.earth_aligner.global_from_local(Vector2(player.facing, 0))
|