it works
This commit is contained in:
16
scripts/killzone.gd
Normal file
16
scripts/killzone.gd
Normal file
@@ -0,0 +1,16 @@
|
||||
extends Area2D
|
||||
|
||||
@onready var timer = $Timer
|
||||
|
||||
func _on_body_entered(body:Node2D) -> void:
|
||||
print("dead.")
|
||||
body.get_node("CollisionShape2D").queue_free()
|
||||
Engine.time_scale = 0.5
|
||||
timer.start()
|
||||
|
||||
|
||||
|
||||
func _on_timer_timeout() -> void:
|
||||
print("reloading")
|
||||
Engine.time_scale = 1.0
|
||||
get_tree().reload_current_scene()
|
||||
Reference in New Issue
Block a user