StormyExtraction/scenes/game/mainGame/main_game.gd
2024-09-15 00:04:31 +02:00

29 lines
622 B
GDScript

extends Node2D
@onready var stormTimer = $StormTimer
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
randomize()
$Map.spawnObjects()
$Map.spawnEnemies()
stormTimer.start(randi_range(G.GAMETIME.MIN, G.GAMETIME.MAX))
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
G.StormTimeLeft = stormTimer.time_left
func _on_storm_timer_timeout() -> void:
print("Storm")
func _on_player_death() -> void:
get_parent().loadEndScren()
func pause():
get_tree().paused = true
func resume():
get_tree().paused = false