Add RulesComponent, GameRulesResource, and BeeDeath state. Update Bee entity with death animation. Include new textures for particles. Add Highlight animation to Beehive.

This commit is contained in:
Dan 2024-05-09 15:08:57 +01:00
parent 1da411cacd
commit d879ca30bd
222 changed files with 3980 additions and 149 deletions

View file

@ -1,4 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://cwutwy11pityw"]
[gd_scene load_steps=3 format=3 uid="uid://cwutwy11pityw"]
[ext_resource type="Script" path="res://ui/scripts/level_complete_component.gd" id="1_qpygu"]
[sub_resource type="LabelSettings" id="LabelSettings_phhcy"]
font_size = 32
@ -10,6 +12,7 @@ anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_qpygu")
[node name="BackgroundOverlay" type="Panel" parent="."]
layout_mode = 1

View file

@ -26,3 +26,70 @@ theme_override_constants/margin_bottom = 10
[node name="NectarBar" type="ProgressBar" parent="MarginContainer"]
unique_name_in_owner = true
layout_mode = 2
[node name="MarginContainer" type="MarginContainer" parent="MarginContainer"]
layout_mode = 2
theme_override_constants/margin_left = 20
theme_override_constants/margin_top = 30
theme_override_constants/margin_right = 20
theme_override_constants/margin_bottom = 20
[node name="LevelTimer" type="Label" parent="MarginContainer/MarginContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 0
theme_override_font_sizes/font_size = 20
text = "00:00:00"
[node name="HelpTextContainer" type="VBoxContainer" parent="MarginContainer/MarginContainer"]
unique_name_in_owner = true
layout_mode = 2
[node name="Help_Drone_Placement_Cancel" type="Label" parent="MarginContainer/MarginContainer/HelpTextContainer"]
visible = false
layout_mode = 2
text = "Right click to cancel placing a drone"
[node name="Help_Drone_Placement_Dancer" type="Label" parent="MarginContainer/MarginContainer/HelpTextContainer"]
visible = false
layout_mode = 2
text = "Place a dancing drone within range of
the hive to tempt bees out. Your time
starts when you place a dancer drone."
[node name="Help_Drone_Placement_Collector" type="Label" parent="MarginContainer/MarginContainer/HelpTextContainer"]
visible = false
layout_mode = 2
text = "Place a collector drone within range
of a flower patch to tell the bees
where they need to go to gather pollen."
[node name="Help_Drone_Placement_Director" type="Label" parent="MarginContainer/MarginContainer/HelpTextContainer"]
visible = false
layout_mode = 2
text = "Use the Director drones to guide bees
around obstacles. Bees fly in straight(ish)
lines between hive, directors, and collectors."
[node name="Help_Drone_Placement_Distractor" type="Label" parent="MarginContainer/MarginContainer/HelpTextContainer"]
visible = false
layout_mode = 2
text = "Use a distractor drone to try and divert a
threats attention away from the bees."
[node name="LevelText" type="Label" parent="MarginContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 0
size_flags_vertical = 8
text = "Level: 1"
[node name="ParText" type="Label" parent="MarginContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 8
size_flags_vertical = 8
tooltip_text = "Par is the number of drones it should take you to complete this level"
mouse_filter = 1
text = "Par: 2"

View file

@ -1,11 +1,8 @@
extends Control
# Called when the node enters the scene tree for the first time.
func _ready():
visible = false
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(_delta):
if GameState.level_complete == true:
visible = true

View file

@ -5,8 +5,13 @@ var update_interval : float = 1
var last_update : float = 0
@onready var nectar_bar = get_node("%NectarBar")
@onready var help_text_container = get_node("%HelpTextContainer")
@onready var help_text_items = help_text_container.get_children()
@onready var level_text_label = get_node("%LevelText")
func _ready():
hide_help_text()
update_ui()
func _process(delta):
@ -22,3 +27,16 @@ func _process(delta):
func update_ui():
nectar_bar.value = GameState.gathered_nectar
nectar_bar.max_value = GameState.required_nectar
func hide_help_text():
for item in help_text_items:
item.hide()
func show_help_text(label: String):
hide_help_text()
for item in help_text_items:
if item.name == label:
item.show()
func update_level_text(text: String):
level_text_label.text = text