Adding required nectar to game state

This commit is contained in:
Dan Baker 2024-05-05 08:01:25 +01:00
parent 5865778c77
commit 0127257d05
3 changed files with 11 additions and 1 deletions

View file

@ -104,7 +104,10 @@ polygon = PackedVector2Array(-18, -11, -6, -21, 17, -19, 23, 1, 3, 12, -18, 7)
[node name="CPUParticles2D" type="CPUParticles2D" parent="Polygon2D"]
position = Vector2(0, 2.46663)
lifetime_randomness = 0.33
gravity = Vector2(0, 0)
linear_accel_min = 5.0
linear_accel_max = 10.0
[node name="Polygon2D" type="Polygon2D" parent="Polygon2D"]
position = Vector2(-13.0817, -6.25862)

View file

@ -21,3 +21,4 @@ func update_ui():
Log.pr("UIComponent update_ui")
nectar_bar.value = GameState.gathered_nectar
nectar_bar.max_value = GameState.required_nectar

View file

@ -1,6 +1,12 @@
class_name GameStateManager extends Node
var gathered_nectar : int = 0
var gathered_nectar : int = 0 :
get:
return gathered_nectar
set(value):
gathered_nectar = value
@export var required_nectar : int = 200
func _ready():
Log.pr("GameStateManager ready")