mirror of
https://github.com/DerTyp7/TopDownShooter-Godot.git
synced 2025-10-28 12:22:10 +01:00
24 lines
422 B
GDScript
24 lines
422 B
GDScript
extends RigidBody2D
|
|
|
|
var destroy_timer := Timer.new()
|
|
|
|
func _ready():
|
|
add_child(destroy_timer)
|
|
destroy_timer.wait_time = 5.0
|
|
destroy_timer.one_shot = true
|
|
destroy_timer.start()
|
|
destroy_timer.connect("timeout", _on_destroy_timer_timeout)
|
|
|
|
|
|
|
|
func _on_destroy_timer_timeout():
|
|
queue_free()
|
|
|
|
|
|
|
|
#func _on_body_entered(body):
|
|
# print("---------------")
|
|
# print(body.name)
|
|
# if "Bullet" not in body.name:
|
|
# queue_free()
|