ape-ame/eptagon.gd

23 lines
533 B
GDScript3
Raw Permalink Normal View History

2024-05-07 21:32:08 -04:00
extends StaticBody2D
2025-02-07 13:37:10 -05:00
var dying = false
2024-05-07 21:32:08 -04:00
# Called when the node enters the scene tree for the first time.
func _ready():
$Turret.target = $"../Player"
#print($Turret.target)
2025-02-07 13:37:10 -05:00
func destroy():
if dying:
return
dying = true
var explosion = load("res://explosion.tscn").instantiate()
$"/root/Node2D".add_child(explosion)
explosion.global_position = global_position
await get_tree().create_timer(0.2).timeout
queue_free()
2024-05-07 21:32:08 -04:00
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass