add killzone and convert Tilemap to Tilelayer
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
extends Area2D
|
||||
|
||||
|
||||
func _on_body_entered(body: Node2D) -> void:
|
||||
func _on_body_entered(_body: Node2D) -> void:
|
||||
print("Plus 1 coin")
|
||||
queue_free()
|
||||
|
||||
11
scripts/killzone.gd
Normal file
11
scripts/killzone.gd
Normal file
@@ -0,0 +1,11 @@
|
||||
extends Area2D
|
||||
|
||||
@onready var timer: Timer = $Timer
|
||||
|
||||
func _on_body_entered(_body: Node2D) -> void:
|
||||
print("You died.")
|
||||
timer.start()
|
||||
|
||||
|
||||
func _on_timer_timeout() -> void:
|
||||
get_tree().reload_current_scene()
|
||||
1
scripts/killzone.gd.uid
Normal file
1
scripts/killzone.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cc1vfgnshjrgf
|
||||
Reference in New Issue
Block a user