From 0ea3b1b96d831e3c5cf4239ffb9bad6c96f262a4 Mon Sep 17 00:00:00 2001 From: Daydreel Date: Wed, 20 Aug 2025 00:58:53 +0200 Subject: [PATCH] Start, defeat, win screen added --- Assets/Models/SM_Cube.glb | Bin 44324 -> 0 bytes Assets/Models/SM_Cube.glb.import | 37 ----------------------- Globals/EventBus.gd | 4 +++ world.gd => Levels/world.gd | 0 world.gd.uid => Levels/world.gd.uid | 0 world.tscn => Levels/world.tscn | 2 +- Tiles/cube.gd | 11 ++++++- Tiles/cube.tscn | 14 +++------ UI/defeat_screen.gd | 5 ++++ UI/defeat_screen.gd.uid | 1 + UI/defeat_screen.tscn | 45 ++++++++++++++++++++++++++++ UI/level_button.gd | 7 +++++ UI/level_button.gd.uid | 1 + UI/level_button.tscn | 9 ++++++ UI/start_menu.tscn | 45 ++++++++++++++++++++++++++++ UI/win_screen.gd | 5 ++++ UI/win_screen.gd.uid | 1 + UI/win_screen.tscn | 45 ++++++++++++++++++++++++++++ enemies/enemy.gd | 2 +- project.godot | 2 +- spawner.gd | 9 ++++-- 21 files changed, 192 insertions(+), 53 deletions(-) delete mode 100644 Assets/Models/SM_Cube.glb delete mode 100644 Assets/Models/SM_Cube.glb.import rename world.gd => Levels/world.gd (100%) rename world.gd.uid => Levels/world.gd.uid (100%) rename world.tscn => Levels/world.tscn (99%) create mode 100644 UI/defeat_screen.gd create mode 100644 UI/defeat_screen.gd.uid create mode 100644 UI/defeat_screen.tscn create mode 100644 UI/level_button.gd create mode 100644 UI/level_button.gd.uid create mode 100644 UI/level_button.tscn create mode 100644 UI/start_menu.tscn create mode 100644 UI/win_screen.gd create mode 100644 UI/win_screen.gd.uid create mode 100644 UI/win_screen.tscn diff --git a/Assets/Models/SM_Cube.glb b/Assets/Models/SM_Cube.glb deleted file mode 100644 index fbde461b892db8bc23d9b43939f29e3a8feb53e1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 44324 zcmeHv2bfh=vh_|V3L+{|P_d0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vTGZrr2~hC!11WsX5J@X?mMDFmBE8yvST=W|~=M z25^R%YNnWJW(;tQ8EGb%gt-8Cff;2kHs_nMz_Dh!S!QlEw*YT3E6mmAeseGIUUQ|n z)7)Wh2HtFLf_JZ33tVe1Gnbo7%o5-dbDNoK7MMlAMP{*?Z>}|~fve3zbA`FoECnt# zx0~zD-^@zjN^_UF#$08V1DBgsW{z2B?grj%ZZtQTHRc}RJ?1+6-#z95-~(nJR$FWC K1Kww5oBs#DOAP7& diff --git a/Assets/Models/SM_Cube.glb.import b/Assets/Models/SM_Cube.glb.import deleted file mode 100644 index ff0d738..0000000 --- a/Assets/Models/SM_Cube.glb.import +++ /dev/null @@ -1,37 +0,0 @@ -[remap] - -importer="scene" -importer_version=1 -type="PackedScene" -uid="uid://wn8v4d1ov3rg" -path="res://.godot/imported/SM_Cube.glb-3d6e772ea9c2777a633e09fa6af3c653.scn" - -[deps] - -source_file="res://Assets/Models/SM_Cube.glb" -dest_files=["res://.godot/imported/SM_Cube.glb-3d6e772ea9c2777a633e09fa6af3c653.scn"] - -[params] - -nodes/root_type="" -nodes/root_name="" -nodes/apply_root_scale=true -nodes/root_scale=1.0 -nodes/import_as_skeleton_bones=false -nodes/use_node_type_suffixes=true -meshes/ensure_tangents=true -meshes/generate_lods=true -meshes/create_shadow_meshes=true -meshes/light_baking=1 -meshes/lightmap_texel_size=0.2 -meshes/force_disable_compression=false -skins/use_named_skins=true -animation/import=true -animation/fps=30 -animation/trimming=false -animation/remove_immutable_tracks=true -animation/import_rest_as_RESET=false -import_script/path="" -_subresources={} -gltf/naming_version=1 -gltf/embedded_image_handling=1 diff --git a/Globals/EventBus.gd b/Globals/EventBus.gd index b0f7113..a1df1b1 100644 --- a/Globals/EventBus.gd +++ b/Globals/EventBus.gd @@ -49,3 +49,7 @@ signal money_received(_value : int) #Emitter : world.gd #Subscriber : cube.gd signal money_spent(_value : int) + +#Emitter : spawner.gd +#Subscriber : cube.gd +signal player_has_won() diff --git a/world.gd b/Levels/world.gd similarity index 100% rename from world.gd rename to Levels/world.gd diff --git a/world.gd.uid b/Levels/world.gd.uid similarity index 100% rename from world.gd.uid rename to Levels/world.gd.uid diff --git a/world.tscn b/Levels/world.tscn similarity index 99% rename from world.tscn rename to Levels/world.tscn index 9e83854..e776525 100644 --- a/world.tscn +++ b/Levels/world.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=17 format=3 uid="uid://ky0uewndeuwv"] -[ext_resource type="Script" uid="uid://qqid42jkpkmv" path="res://world.gd" id="1_fj7yv"] +[ext_resource type="Script" uid="uid://qqid42jkpkmv" path="res://Levels/world.gd" id="1_fj7yv"] [ext_resource type="PackedScene" uid="uid://d1f6m15niwgt" path="res://Tiles/tile.tscn" id="3_aqk2v"] [ext_resource type="PackedScene" uid="uid://d17sleiqkdoo2" path="res://Assets/GLB format/selection-a.glb" id="3_tlwt5"] [ext_resource type="PackedScene" uid="uid://do7gm1gjhu1t5" path="res://Tiles/road.tscn" id="4_036b0"] diff --git a/Tiles/cube.gd b/Tiles/cube.gd index cab7b0d..4963fc8 100644 --- a/Tiles/cube.gd +++ b/Tiles/cube.gd @@ -21,6 +21,7 @@ func _ready() -> void: call_deferred("display_money_on_first_call") EventBus.money_received.connect(_on_EventBus_money_received) EventBus.money_spent.connect(_on_EventBus_money_spent) + EventBus.player_has_won.connect(_on_EventBus_player_has_won) #Because I can't connect properly on first frame and send money info func display_money_on_first_call() -> void: @@ -31,8 +32,12 @@ func take_damage(damage : int) -> void: health -= damage +func win(): + get_tree().change_scene_to_file("res://UI/win_screen.tscn") + + func death(): - print("GAME OVER") + get_tree().change_scene_to_file("res://UI/defeat_screen.tscn") func _on_EventBus_money_received(money_received : int): money += money_received @@ -40,3 +45,7 @@ func _on_EventBus_money_received(money_received : int): func _on_EventBus_money_spent(money_spent : int): money -= money_spent + + +func _on_EventBus_player_has_won(): + win() diff --git a/Tiles/cube.tscn b/Tiles/cube.tscn index 60633fd..83b2ad2 100644 --- a/Tiles/cube.tscn +++ b/Tiles/cube.tscn @@ -1,23 +1,17 @@ -[gd_scene load_steps=5 format=3 uid="uid://dpjfo15otkfru"] +[gd_scene load_steps=4 format=3 uid="uid://dpjfo15otkfru"] [ext_resource type="Script" uid="uid://bjbmd8pcg5jr8" path="res://Tiles/cube.gd" id="1_wrmut"] -[ext_resource type="PackedScene" uid="uid://wn8v4d1ov3rg" path="res://Assets/Models/SM_Cube.glb" id="2_lacym"] +[ext_resource type="PackedScene" uid="uid://c6ceaa6x357bb" path="res://Assets/Meshes/SM_Cube.glb" id="2_lacym"] [sub_resource type="BoxShape3D" id="BoxShape3D_ppsqf"] -[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_wrmut"] -albedo_color = Color(0.051971, 0.051971, 0.051971, 1) - [node name="TheCube" type="StaticBody3D"] collision_layer = 8 collision_mask = 8 script = ExtResource("1_wrmut") [node name="CollisionShape3D" type="CollisionShape3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.473172, 0) shape = SubResource("BoxShape3D_ppsqf") -[node name="CSGBox3D" type="CSGBox3D" parent="."] -material = SubResource("StandardMaterial3D_wrmut") - -[node name="SM_Cube" parent="." instance=ExtResource("2_lacym")] -transform = Transform3D(1.5, 0, 0, 0, 1.5, 0, 0, 0, 1.5, 0, 0, 0) +[node name="SM_Cube2" parent="." instance=ExtResource("2_lacym")] diff --git a/UI/defeat_screen.gd b/UI/defeat_screen.gd new file mode 100644 index 0000000..f8a7743 --- /dev/null +++ b/UI/defeat_screen.gd @@ -0,0 +1,5 @@ +extends Control +class_name DefeatScreen + +func _on_timer_timeout() -> void: + get_tree().change_scene_to_file("res://UI/start_menu.tscn") diff --git a/UI/defeat_screen.gd.uid b/UI/defeat_screen.gd.uid new file mode 100644 index 0000000..459467e --- /dev/null +++ b/UI/defeat_screen.gd.uid @@ -0,0 +1 @@ +uid://vjlwfv5wjs1n diff --git a/UI/defeat_screen.tscn b/UI/defeat_screen.tscn new file mode 100644 index 0000000..ca845b4 --- /dev/null +++ b/UI/defeat_screen.tscn @@ -0,0 +1,45 @@ +[gd_scene load_steps=3 format=3 uid="uid://yonrrq1fbs3b"] + +[ext_resource type="Script" uid="uid://vjlwfv5wjs1n" path="res://UI/defeat_screen.gd" id="1_g253y"] + +[sub_resource type="LabelSettings" id="LabelSettings_i0rmf"] +font_size = 70 + +[node name="DefeatScreen" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_g253y") + +[node name="Panel" type="Panel" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="Label" type="Label" parent="."] +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -20.0 +offset_top = -11.5 +offset_right = 20.0 +offset_bottom = 11.5 +grow_horizontal = 2 +grow_vertical = 2 +text = "Burned out !" +label_settings = SubResource("LabelSettings_i0rmf") + +[node name="Timer" type="Timer" parent="."] +wait_time = 3.0 +autostart = true + +[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"] diff --git a/UI/level_button.gd b/UI/level_button.gd new file mode 100644 index 0000000..fa736b2 --- /dev/null +++ b/UI/level_button.gd @@ -0,0 +1,7 @@ +extends Button +class_name LevelButton + +@export_file("*.tscn") var level : String + +func _on_pressed() -> void: + get_tree().change_scene_to_file(level) diff --git a/UI/level_button.gd.uid b/UI/level_button.gd.uid new file mode 100644 index 0000000..5654678 --- /dev/null +++ b/UI/level_button.gd.uid @@ -0,0 +1 @@ +uid://cudalakmyqm04 diff --git a/UI/level_button.tscn b/UI/level_button.tscn new file mode 100644 index 0000000..dd30b20 --- /dev/null +++ b/UI/level_button.tscn @@ -0,0 +1,9 @@ +[gd_scene load_steps=2 format=3 uid="uid://88elnilxithv"] + +[ext_resource type="Script" uid="uid://cudalakmyqm04" path="res://UI/level_button.gd" id="1_k6cd2"] + +[node name="Level1Button" type="Button"] +text = "Level 1" +script = ExtResource("1_k6cd2") + +[connection signal="pressed" from="." to="." method="_on_pressed"] diff --git a/UI/start_menu.tscn b/UI/start_menu.tscn new file mode 100644 index 0000000..b4f3ad2 --- /dev/null +++ b/UI/start_menu.tscn @@ -0,0 +1,45 @@ +[gd_scene load_steps=2 format=3 uid="uid://2xw1yn1tmlcy"] + +[ext_resource type="PackedScene" uid="uid://88elnilxithv" path="res://UI/level_button.tscn" id="1_dl586"] + +[node name="StartMenu" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="Panel" type="Panel" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="."] +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -94.5 +offset_top = -20.0 +offset_right = 94.5 +offset_bottom = 20.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="Label" type="Label" parent="VBoxContainer"] +layout_mode = 2 +text = "Pole Pixel Defense Force" + +[node name="Level1Button" parent="VBoxContainer" instance=ExtResource("1_dl586")] +layout_mode = 2 +level = "uid://ky0uewndeuwv" + +[node name="QuitButton" type="Button" parent="VBoxContainer"] +layout_mode = 2 +text = "Quit" diff --git a/UI/win_screen.gd b/UI/win_screen.gd new file mode 100644 index 0000000..212c688 --- /dev/null +++ b/UI/win_screen.gd @@ -0,0 +1,5 @@ +extends Control +class_name WinScreen + +func _on_timer_timeout() -> void: + get_tree().change_scene_to_file("res://UI/start_menu.tscn") diff --git a/UI/win_screen.gd.uid b/UI/win_screen.gd.uid new file mode 100644 index 0000000..9d29051 --- /dev/null +++ b/UI/win_screen.gd.uid @@ -0,0 +1 @@ +uid://camwpkoj31gvn diff --git a/UI/win_screen.tscn b/UI/win_screen.tscn new file mode 100644 index 0000000..1bcde51 --- /dev/null +++ b/UI/win_screen.tscn @@ -0,0 +1,45 @@ +[gd_scene load_steps=3 format=3 uid="uid://c4ipdjq2xej6j"] + +[ext_resource type="Script" uid="uid://camwpkoj31gvn" path="res://UI/win_screen.gd" id="1_t25dr"] + +[sub_resource type="LabelSettings" id="LabelSettings_i0rmf"] +font_size = 70 + +[node name="WinScreen" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_t25dr") + +[node name="Panel" type="Panel" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="Label" type="Label" parent="."] +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -20.0 +offset_top = -11.5 +offset_right = 20.0 +offset_bottom = 11.5 +grow_horizontal = 2 +grow_vertical = 2 +text = "It's the week-end !" +label_settings = SubResource("LabelSettings_i0rmf") + +[node name="Timer" type="Timer" parent="."] +wait_time = 3.0 +autostart = true + +[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"] diff --git a/enemies/enemy.gd b/enemies/enemy.gd index 5a31a7b..4a04910 100644 --- a/enemies/enemy.gd +++ b/enemies/enemy.gd @@ -54,7 +54,7 @@ func attack(): func death() -> void: is_alive = false - #Global.enemies_alive -= 1 + GameManager.enemies_alive -= 1 EventBus.money_received.emit(money) $Sprite3D.visible = false var death_vfx : CPUParticles3D = death_vfx_packed.instantiate() diff --git a/project.godot b/project.godot index 37f64b0..6146bec 100644 --- a/project.godot +++ b/project.godot @@ -11,7 +11,7 @@ config_version=5 [application] config/name="Pole Pixel Defense Force" -run/main_scene="uid://ky0uewndeuwv" +run/main_scene="uid://2xw1yn1tmlcy" config/features=PackedStringArray("4.4") config/icon="res://icon.svg" diff --git a/spawner.gd b/spawner.gd index 5da3af6..5d01d78 100644 --- a/spawner.gd +++ b/spawner.gd @@ -10,7 +10,10 @@ var can_spawn : bool = false var wave_on_going : bool = false func spawn_next_wave() -> void: - + if waves.is_empty(): + EventBus.player_has_won.emit() + return + current_wave = waves.pop_front() $SpawnTimer.start(current_wave.wait_time_before_next_wave) @@ -34,13 +37,15 @@ func spawn_manager() -> void: if !can_spawn: return + #Send next troop if !current_wave.troops.is_empty() and enemies_to_spawn == 0: current_troop = current_wave.troops.pop_front() enemies_to_spawn = current_troop.number_to_spawn + if enemies_to_spawn > 0: spawn() - + print(GameManager.enemies_alive) if GameManager.enemies_alive > 0: wave_on_going = true else: