brackeys-12/ui.gd

15 lines
476 B
GDScript3
Raw Normal View History

2024-09-15 02:50:11 +00:00
extends CanvasLayer
@onready var animation_player: AnimationPlayer = $AnimationPlayer
2024-09-15 03:23:38 +00:00
func _ready() -> void:
2024-09-15 04:25:59 +00:00
Persister.persist_data("wood", 50)
Persister.persist_data("stone", 50)
2024-09-15 03:43:31 +00:00
Persister.persist_data("population", 3)
Persister.persist_data("max_population", 3)
2024-09-15 02:50:11 +00:00
func _process(delta: float) -> void:
if Input.is_action_just_pressed("lclick") and not Persister.get_value("game_started"):
Persister.persist_data("game_started", true)
animation_player.play("start")