18 lines
559 B
GDScript
18 lines
559 B
GDScript
extends ActiveItem
|
|
@export var cooldown = 0.3
|
|
@export var arrow_scene : PackedScene
|
|
|
|
func actually_collect():
|
|
player.set_cooldown(cooldown)
|
|
|
|
|
|
func activate():
|
|
player.activate_cooldown()
|
|
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))
|
|
if(player.facing == -1):
|
|
arrow.get_node("Sprite2D").scale.x = - arrow.get_node("Sprite2D").scale.x
|
|
$SoundBowRelease.play()
|