Update bee animations, game over component UI, and game state handling. Set up game over conditions based on the number of dead bees.

This commit is contained in:
Dan 2024-05-11 16:09:57 +01:00
parent 2a4a578f19
commit f4e2169009
11 changed files with 203 additions and 37 deletions

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=15 format=3 uid="uid://dalh10tit6qg"]
[gd_scene load_steps=16 format=3 uid="uid://dalh10tit6qg"]
[ext_resource type="PackedScene" uid="uid://dn6aa6f2f4g4i" path="res://components/RulesComponent.tscn" id="1_g1iu7"]
[ext_resource type="Script" path="res://levels/scripts/level_1.gd" id="1_jrhhc"]
@ -14,6 +14,7 @@
[ext_resource type="PackedScene" uid="uid://b7eeptlk47ymd" path="res://ui/UiComponent.tscn" id="11_ndtvv"]
[ext_resource type="PackedScene" uid="uid://ct3c16xm33r2a" path="res://scenes/elements/drone_manager.tscn" id="12_37aah"]
[ext_resource type="PackedScene" uid="uid://cwutwy11pityw" path="res://ui/LevelCompleteComponent.tscn" id="13_we755"]
[ext_resource type="PackedScene" uid="uid://b5whit1dshr3" path="res://ui/GameOverComponent.tscn" id="15_jn0bj"]
[node name="Level1" type="Node2D"]
script = ExtResource("1_jrhhc")
@ -149,3 +150,8 @@ z_index = 1000
offset_right = 1280.0
offset_bottom = 720.0
mouse_filter = 1
[node name="GameOverComponent" parent="." instance=ExtResource("15_jn0bj")]
z_index = 900
offset_right = 1280.0
offset_bottom = 720.0

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=16 format=3 uid="uid://dcgmtmjsrtafq"]
[gd_scene load_steps=17 format=3 uid="uid://dcgmtmjsrtafq"]
[ext_resource type="Script" path="res://levels/scripts/level_2.gd" id="1_dtbi3"]
[ext_resource type="PackedScene" uid="uid://dn6aa6f2f4g4i" path="res://components/RulesComponent.tscn" id="2_gln7y"]
@ -15,6 +15,7 @@
[ext_resource type="PackedScene" uid="uid://b7eeptlk47ymd" path="res://ui/UiComponent.tscn" id="12_mmtyl"]
[ext_resource type="PackedScene" uid="uid://ct3c16xm33r2a" path="res://scenes/elements/drone_manager.tscn" id="13_pibpn"]
[ext_resource type="PackedScene" uid="uid://cwutwy11pityw" path="res://ui/LevelCompleteComponent.tscn" id="14_uyhgj"]
[ext_resource type="PackedScene" uid="uid://b5whit1dshr3" path="res://ui/GameOverComponent.tscn" id="16_450js"]
[node name="Level2" type="Node2D"]
script = ExtResource("1_dtbi3")
@ -152,3 +153,8 @@ visible = false
z_index = 999
offset_right = 1280.0
offset_bottom = 720.0
[node name="GameOverComponent" parent="." instance=ExtResource("16_450js")]
z_index = 900
offset_right = 1280.0
offset_bottom = 720.0

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=16 format=3 uid="uid://bw12t0pk5eecr"]
[gd_scene load_steps=17 format=3 uid="uid://bw12t0pk5eecr"]
[ext_resource type="Script" path="res://levels/scripts/level_3.gd" id="1_6fiq4"]
[ext_resource type="PackedScene" uid="uid://dn6aa6f2f4g4i" path="res://components/RulesComponent.tscn" id="2_qf6aq"]
@ -15,6 +15,7 @@
[ext_resource type="PackedScene" uid="uid://b7eeptlk47ymd" path="res://ui/UiComponent.tscn" id="13_cw1ps"]
[ext_resource type="PackedScene" uid="uid://ct3c16xm33r2a" path="res://scenes/elements/drone_manager.tscn" id="14_mtjsg"]
[ext_resource type="PackedScene" uid="uid://cwutwy11pityw" path="res://ui/LevelCompleteComponent.tscn" id="15_1jo0f"]
[ext_resource type="PackedScene" uid="uid://b5whit1dshr3" path="res://ui/GameOverComponent.tscn" id="16_61bnh"]
[node name="Level3" type="Node2D"]
script = ExtResource("1_6fiq4")
@ -184,3 +185,8 @@ visible = false
z_index = 999
offset_right = 1280.0
offset_bottom = 720.0
[node name="GameOverComponent" parent="." instance=ExtResource("16_61bnh")]
z_index = 900
offset_right = 1280.0
offset_bottom = 720.0

View file

@ -10,6 +10,8 @@ func _ready():
func update_game_state():
GameState.required_nectar = rules.game_rules.nectar_required
GameState.level_par = rules.game_rules.level_par
GameState.level_number = rules.game_rules.level_number
GameState.bees_available = rules.game_rules.bees_available
ui_controls.update_level_text("Level : " + str(rules.game_rules.level_number))
ui_controls.update_par_text("Par : " + str(rules.game_rules.level_par))
bee_spawner.max_bees = rules.game_rules.bees_available