brackeys-12/storm_manager.gd

34 lines
481 B
GDScript3
Raw Permalink 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
var game_time = 0
var last_flood_time = 0
var current_flood_state = 0
var flood_levels = [
0,
1,
0,
2,
1,
3,
1,
0,
2,
1,
4,
2,
5
]
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
Persister.persist_data("flood_level", flood_levels[current_flood_state])