added fireballs

This commit is contained in:
Jonas Braus
2024-07-29 23:30:26 +02:00
parent 3a6f8517c0
commit 85736f82e0
19 changed files with 365 additions and 39 deletions
+23
View File
@@ -0,0 +1,23 @@
extends RigidBody2D
@onready var timer = $Timer
var enter_count = 0
# Called when the node enters the scene tree for the first time.
func _ready():
timer.start()
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func _on_timer_timeout():
queue_free()
func _on_area_2d_body_entered(body):
enter_count += 1
if enter_count > 2:
queue_free()
func _on_enemie_die_body_entered(body):
body.f_die()
queue_free()