use onready for timer

This commit is contained in:
pennyrigate 2023-01-15 02:43:07 -05:00
parent d3c62d6995
commit ec18f636b2
3 changed files with 63 additions and 18 deletions

File diff suppressed because one or more lines are too long

View file

@ -8,11 +8,10 @@ onready var timer = $Timer
func _physics_process(delta):
if fall:
position.y += fall_speed
Debug.print($Timer.get_time_left())
func _on_Area2D_area_entered(area):
if area.is_in_group("player"):
$Timer.start()
timer.start()
func _on_VisibilityNotifier2D_screen_exited():
@ -25,5 +24,5 @@ func _on_Timer_timeout():
func _on_Area2D_area_exited(area):
$Timer.stop()
timer.stop()

View file

@ -113,3 +113,5 @@ func _enter_code():
enemy.queue_free()
"DGSTEEZY":
debug = true
"6DOUBLOONS":
Debug.print(get_tree().get_nodes_in_group("gold").size())