This commit is contained in:
2026-10-07 17:58:02 +08:00
commit 456aa52ede
409 changed files with 11297 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
extends Area2D
@onready var animated = $AnimatedSprite2D
var target : Node2D = null
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
animated.play("ROLL")
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
if target:
if target.has_method("take_damage"):
target.take_damage(1)
func _on_body_entered(body: Node2D) -> void:
if body.is_in_group("Player"):
target = body
func _on_body_exited(body: Node2D) -> void:
if body.is_in_group("Player"):
target = null