brackeys-12/storm/storm_manager.gd

19 lines
415 B
GDScript3
Raw Normal View History

2024-09-08 23:15:20 +00:00
extends Node
2024-09-08 23:17:19 +00:00
@onready var globals = Data.data.globals
2024-09-10 13:03:27 +00:00
2024-09-08 23:17:19 +00:00
var game_time = 0
var last_flood_time = 0
var current_flood_state = 0
func _process(delta: float) -> void:
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
2024-09-09 01:17:35 +00:00
Persister.persist_data("flood_level", globals.flood_levels[current_flood_state])