brackeys-12/storm/storm_manager.gd
2024-09-15 01:37:02 -04:00

21 lines
471 B
GDScript

extends Node
@onready var globals = Data.data.globals
var game_time = 0
var last_flood_time = 0
var current_flood_state = 0
func _process(delta: float) -> void:
if not Persister.get_value("game_started"):
return
game_time += delta
if last_flood_time + globals.time_to_flood_change < game_time:
last_flood_time += globals.time_to_flood_change
current_flood_state += 1
Persister.persist_data("flood_level", globals.flood_levels[current_flood_state])