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

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()