Guest User

Event_Manager.gd

a guest
Feb 19th, 2024
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. extends Node2D
  2.  
  3. @export var time : int
  4. var countdownTimer = preload("res://Scenes/UI/Level_Countdown.tscn").instantiate()
  5.  
  6. func _ready():
  7.     countdownTimer.timerWaitTime = time
  8.     %HUD.add_child(countdownTimer)
  9.     var timerToConnect = countdownTimer.get_node("countdownTimer")
  10.    
  11.     match timerToConnect:
  12.         false:
  13.             print("Timer not found, did you spell the name right in the get_node arguement?")
  14.        
  15.         true:
  16.             timerToConnect.connect("timeout", Callable(_onTimesUp()))
  17.  
  18. func _onTimesUp():
  19.     %Player.queue_free()
  20.     %HUD.queue_free()
  21.     var gameOverScreen : Label
  22. #TODO
Advertisement
Add Comment
Please, Sign In to add comment