back end degat vie

This commit is contained in:
Elouan 2025-01-25 02:33:26 +01:00
parent c3d84f1e17
commit 7b66e219b2
8 changed files with 138 additions and 14 deletions

View file

@ -0,0 +1,19 @@
extends Area2D
var direction = Vector2.ZERO
var timer = 0.0
var cooldown = 0.7
func _process(delta: float) -> void:
timer += delta
if timer >= cooldown:
queue_free()
func set_direction(direction: Vector2) -> void:
self.direction = direction
func Collision(body: Node2D) -> void:
if body.is_in_group("Player"):
body.take_damage(3)