Reorganize file structure of project
This commit is contained in:
29
Entities/Weapons/Projectiles/Scripts/wooden_arrow.gd
Normal file
29
Entities/Weapons/Projectiles/Scripts/wooden_arrow.gd
Normal file
@@ -0,0 +1,29 @@
|
||||
extends BaseProjectile
|
||||
class_name WoodenArrow
|
||||
|
||||
@onready var animation_player: AnimationPlayer = $AnimationPlayer
|
||||
|
||||
var _despawn_queued := false
|
||||
|
||||
# Private Methods
|
||||
func _ready() -> void:
|
||||
speed = 8000
|
||||
|
||||
|
||||
func _on_collision_detector_area_entered(_area: Area2D) -> void:
|
||||
queue_despawn()
|
||||
|
||||
|
||||
func _on_collision_detector_body_entered(body: Node2D) -> void:
|
||||
if body == self: return
|
||||
queue_despawn()
|
||||
|
||||
|
||||
func queue_despawn() -> void:
|
||||
if _despawn_queued: return
|
||||
_despawn_queued = true
|
||||
|
||||
animation_player.play("shaking")
|
||||
await animation_player.animation_finished
|
||||
|
||||
queue_free()
|
||||
Reference in New Issue
Block a user