forked from team-sg/hero-mark-2
use onready for timer
This commit is contained in:
parent
d3c62d6995
commit
ec18f636b2
3 changed files with 63 additions and 18 deletions
File diff suppressed because one or more lines are too long
|
@ -8,11 +8,10 @@ onready var timer = $Timer
|
||||||
func _physics_process(delta):
|
func _physics_process(delta):
|
||||||
if fall:
|
if fall:
|
||||||
position.y += fall_speed
|
position.y += fall_speed
|
||||||
Debug.print($Timer.get_time_left())
|
|
||||||
|
|
||||||
func _on_Area2D_area_entered(area):
|
func _on_Area2D_area_entered(area):
|
||||||
if area.is_in_group("player"):
|
if area.is_in_group("player"):
|
||||||
$Timer.start()
|
timer.start()
|
||||||
|
|
||||||
|
|
||||||
func _on_VisibilityNotifier2D_screen_exited():
|
func _on_VisibilityNotifier2D_screen_exited():
|
||||||
|
@ -25,5 +24,5 @@ func _on_Timer_timeout():
|
||||||
|
|
||||||
|
|
||||||
func _on_Area2D_area_exited(area):
|
func _on_Area2D_area_exited(area):
|
||||||
$Timer.stop()
|
timer.stop()
|
||||||
|
|
||||||
|
|
|
@ -113,3 +113,5 @@ func _enter_code():
|
||||||
enemy.queue_free()
|
enemy.queue_free()
|
||||||
"DGSTEEZY":
|
"DGSTEEZY":
|
||||||
debug = true
|
debug = true
|
||||||
|
"6DOUBLOONS":
|
||||||
|
Debug.print(get_tree().get_nodes_in_group("gold").size())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue