13 lines
376 B
GDScript3
13 lines
376 B
GDScript3
|
|
extends ActiveItem
|
||
|
|
@export var cooldown = 1
|
||
|
|
@export var arrow_scene : PackedScene
|
||
|
|
|
||
|
|
|
||
|
|
func activate():
|
||
|
|
player.item_cooldown = 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))
|