From 9a16e4b1085ede74f9f36a6dcf4756bbb423e347 Mon Sep 17 00:00:00 2001 From: Victor Turgeon Date: Wed, 11 Oct 2023 10:28:58 -0400 Subject: [PATCH 1/4] button style --- Scenes/ending.tscn | 10 ++++---- Scenes/start_menu.tscn | 29 ++++++++++++++++++++++- Themes/base_theme.tres | 53 +++++++++++++++++++++++++++++++++++++++++- 3 files changed, 85 insertions(+), 7 deletions(-) diff --git a/Scenes/ending.tscn b/Scenes/ending.tscn index bfbfdc8..695b4af 100644 --- a/Scenes/ending.tscn +++ b/Scenes/ending.tscn @@ -657,7 +657,7 @@ size_flags_horizontal = 3 [node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="TotalArmyComp/Separation/ArmyTotals/Bats/Control"] position = Vector2(24, 18) sprite_frames = SubResource("SpriteFrames_kjfbi") -frame_progress = 0.806293 +frame_progress = 0.761512 [node name="2Points" type="Label" parent="TotalArmyComp/Separation/ArmyTotals/Bats"] layout_mode = 2 @@ -685,7 +685,7 @@ size_flags_horizontal = 3 [node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="TotalArmyComp/Separation/ArmyTotals/Wolves/Control"] position = Vector2(24, 16) sprite_frames = SubResource("SpriteFrames_h2asb") -frame_progress = 0.808144 +frame_progress = 0.763364 [node name="2Points" type="Label" parent="TotalArmyComp/Separation/ArmyTotals/Wolves"] layout_mode = 2 @@ -713,7 +713,7 @@ size_flags_horizontal = 3 [node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="TotalArmyComp/Separation/ArmyTotals/Necromancers/Control"] position = Vector2(24, 22) sprite_frames = SubResource("SpriteFrames_0hwvy") -frame_progress = 0.223527 +frame_progress = 0.178747 [node name="2Points" type="Label" parent="TotalArmyComp/Separation/ArmyTotals/Necromancers"] layout_mode = 2 @@ -741,7 +741,7 @@ size_flags_horizontal = 3 [node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="TotalArmyComp/Separation/ArmyTotals/Pit Fiends/Control"] position = Vector2(24, 22) sprite_frames = SubResource("SpriteFrames_3y7oi") -frame_progress = 0.437328 +frame_progress = 0.392548 [node name="2Points" type="Label" parent="TotalArmyComp/Separation/ArmyTotals/Pit Fiends"] layout_mode = 2 @@ -821,7 +821,7 @@ flip_h = true position = Vector2(784, 288) scale = Vector2(7.765, 7.765) sprite_frames = SubResource("SpriteFrames_5yana") -frame_progress = 0.910776 +frame_progress = 0.865996 flip_h = true [connection signal="pressed" from="Quit" to="." method="_on_quit_pressed"] diff --git a/Scenes/start_menu.tscn b/Scenes/start_menu.tscn index 0ab27b1..3d008bc 100644 --- a/Scenes/start_menu.tscn +++ b/Scenes/start_menu.tscn @@ -1,10 +1,22 @@ -[gd_scene load_steps=6 format=3 uid="uid://bkt0gdgv7bsx2"] +[gd_scene load_steps=7 format=3 uid="uid://bkt0gdgv7bsx2"] [ext_resource type="Script" path="res://Scripts/start_menu.gd" id="1_dgae7"] [ext_resource type="PackedScene" uid="uid://b8s2seg2lf7wo" path="res://Scenes/Tilemaps/tileset_1.tscn" id="2_0sfou"] [ext_resource type="Theme" uid="uid://dr1h7to56a2pv" path="res://Themes/base_theme.tres" id="3_puxi3"] [ext_resource type="Texture2D" uid="uid://cxk21atb8fblp" path="res://Assets/Witch/noBKG_WitchThrow_strip.png" id="4_qq6xh"] +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_1owyk"] +bg_color = Color(0.6, 0.6, 0.6, 0) +border_width_left = 50 +border_width_top = 50 +border_width_right = 50 +border_width_bottom = 50 +border_color = Color(0.254902, 0, 0, 1) +border_blend = true +shadow_color = Color(0.223529, 0.0117647, 0.0745098, 0.6) +shadow_size = 20 +anti_aliasing_size = 2.606 + [sub_resource type="AtlasTexture" id="AtlasTexture_je3v2"] atlas = ExtResource("4_qq6xh") region = Rect2(1024, 0, 64, 64) @@ -20,6 +32,19 @@ script = ExtResource("1_dgae7") [node name="TileSet1" parent="." instance=ExtResource("2_0sfou")] +[node name="border" type="PanelContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = -24.0 +offset_top = -16.0 +offset_right = 16.0 +offset_bottom = 20.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_styles/panel = SubResource("StyleBoxFlat_1owyk") + [node name="ColorRect" type="ColorRect" parent="."] layout_mode = 1 anchors_preset = 15 @@ -39,6 +64,7 @@ offset_top = -92.0 offset_right = 442.0 offset_bottom = -45.0 grow_vertical = 0 +theme = ExtResource("3_puxi3") text = "Start" [node name="QuitButton" type="Button" parent="."] @@ -54,6 +80,7 @@ offset_right = -305.0 offset_bottom = -45.0 grow_horizontal = 0 grow_vertical = 0 +theme = ExtResource("3_puxi3") text = "Quit " diff --git a/Themes/base_theme.tres b/Themes/base_theme.tres index c42de8b..16a3f63 100644 --- a/Themes/base_theme.tres +++ b/Themes/base_theme.tres @@ -1,7 +1,53 @@ -[gd_resource type="Theme" load_steps=4 format=3 uid="uid://dr1h7to56a2pv"] +[gd_resource type="Theme" load_steps=9 format=3 uid="uid://dr1h7to56a2pv"] [ext_resource type="FontFile" uid="uid://01mccw37teq2" path="res://Assets/Fonts/alagard.ttf" id="1_i16b1"] +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_atud8"] +bg_color = Color(0.192157, 0.0941176, 0.0784314, 1) +border_width_left = 1 +border_width_top = 1 +border_color = Color(0, 0, 0, 1) +border_blend = true +corner_radius_top_left = 10 +corner_detail = 1 +anti_aliasing = false + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_5vpqh"] +bg_color = Color(0.54902, 0.321569, 0.286275, 1) +border_width_left = 1 +border_width_top = 1 +border_color = Color(0.286275, 0.0784314, 0.172549, 1) +corner_radius_top_left = 10 +corner_detail = 1 +anti_aliasing = false + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_sphu5"] +bg_color = Color(0.584314, 0.345098, 0.309804, 1) +border_width_left = 1 +border_width_top = 1 +border_color = Color(0.137255, 0.137255, 0.137255, 1) +corner_radius_top_left = 10 +corner_detail = 1 +anti_aliasing = false + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ynkwh"] +bg_color = Color(0.466667, 0.266667, 0.235294, 1) +border_width_left = 1 +border_width_top = 1 +border_color = Color(0.137255, 0.137255, 0.137255, 1) +corner_radius_top_left = 10 +corner_detail = 1 +anti_aliasing = false + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_vl5pg"] +bg_color = Color(0.294118, 0.156863, 0.137255, 1) +border_width_left = 1 +border_width_top = 1 +border_color = Color(0.494118, 0.0235294, 0.145098, 1) +corner_radius_top_left = 5 +corner_detail = 1 +anti_aliasing = false + [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_hf10d"] bg_color = Color(0.403922, 0.0117647, 0.0627451, 0.188235) @@ -10,6 +56,11 @@ bg_color = Color(0.803922, 0.152941, 0.188235, 1) [resource] Button/fonts/font = ExtResource("1_i16b1") +Button/styles/disabled = SubResource("StyleBoxFlat_atud8") +Button/styles/focus = SubResource("StyleBoxFlat_5vpqh") +Button/styles/hover = SubResource("StyleBoxFlat_sphu5") +Button/styles/normal = SubResource("StyleBoxFlat_ynkwh") +Button/styles/pressed = SubResource("StyleBoxFlat_vl5pg") Label/fonts/font = ExtResource("1_i16b1") PanelContainer/styles/panel = null ProgressBar/styles/background = SubResource("StyleBoxFlat_hf10d") From bd4e70f02bdd38db89e7815ea1d1cd744cc437a7 Mon Sep 17 00:00:00 2001 From: Victor Turgeon Date: Wed, 11 Oct 2023 10:37:23 -0400 Subject: [PATCH 2/4] time remaining in ending page --- Scenes/Levels/level_1.tscn | 2 +- Scenes/ending.tscn | 33 ++++++++++++++++++++++++++++++++- Scripts/ending.gd | 6 +++++- Scripts/level.gd | 1 + 4 files changed, 39 insertions(+), 3 deletions(-) diff --git a/Scenes/Levels/level_1.tscn b/Scenes/Levels/level_1.tscn index b288a14..7d09f92 100644 --- a/Scenes/Levels/level_1.tscn +++ b/Scenes/Levels/level_1.tscn @@ -3,7 +3,7 @@ [ext_resource type="Script" path="res://Scripts/level.gd" id="1_0nmok"] [ext_resource type="PackedScene" uid="uid://b8s2seg2lf7wo" path="res://Scenes/Tilemaps/tileset_1.tscn" id="1_4n82n"] [ext_resource type="PackedScene" uid="uid://cl7w6ndvons1a" path="res://Scenes/Props/candle_1.tscn" id="2_5hdq4"] -[ext_resource type="PackedScene" uid="uid://cf7al5uln33rn" path="res://Scenes/Props/candle_2.tscn" id="2_o33c4"] +[ext_resource type="PackedScene" uid="uid://by2xmwcng01uy" path="res://Scenes/Props/candle_2.tscn" id="2_o33c4"] [ext_resource type="PackedScene" uid="uid://b5lnjonlf4i1b" path="res://Scenes/enemy.tscn" id="4_g0oey"] [ext_resource type="PackedScene" uid="uid://0onqgygm832d" path="res://Scenes/Player/player.tscn" id="5_ik47y"] [ext_resource type="AudioStream" uid="uid://c3dy35dv368ft" path="res://Assets/Music/SisNeufPiDoozHuit.mp3" id="7_but47"] diff --git a/Scenes/ending.tscn b/Scenes/ending.tscn index c0cf4ec..1f0b372 100644 --- a/Scenes/ending.tscn +++ b/Scenes/ending.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=87 format=3 uid="uid://drfn4qb06jfla"] +[gd_scene load_steps=88 format=3 uid="uid://v0vtf1d1iusm"] [ext_resource type="Script" path="res://Scripts/ending.gd" id="1_1hyxj"] [ext_resource type="PackedScene" uid="uid://b8s2seg2lf7wo" path="res://Scenes/Tilemaps/tileset_1.tscn" id="2_yeqls"] @@ -11,6 +11,7 @@ [ext_resource type="Texture2D" uid="uid://ckeayob6k71b1" path="res://Assets/Witch/noBKG_WitchIdle_strip.png" id="7_wm35e"] [ext_resource type="Texture2D" uid="uid://dyoeqid128gvx" path="res://Assets/Golem/noBKG_GolemIdle_strip.png" id="8_gwm2y"] [ext_resource type="Texture2D" uid="uid://b3a5g03ukunfa" path="res://Assets/Knight/noBKG_KnightIdle_strip.png" id="10_hwaw0"] +[ext_resource type="Texture2D" uid="uid://iy5flm8rgj60" path="res://Assets/Inverted hourglass1.png" id="12_iov5c"] [sub_resource type="AtlasTexture" id="AtlasTexture_6btik"] atlas = ExtResource("5_pr1ps") @@ -831,4 +832,34 @@ stream = ExtResource("3_q0fqf") pitch_scale = 0.4 autoplay = true +[node name="Time" type="Control" parent="."] +layout_mode = 3 +anchors_preset = 0 +offset_left = 320.0 +offset_top = 96.0 +offset_right = 320.0 +offset_bottom = 96.0 +size_flags_vertical = 3 + +[node name="HBoxContainer" type="HBoxContainer" parent="Time"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_top = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="Hourglass" type="TextureRect" parent="Time/HBoxContainer"] +layout_mode = 2 +texture = ExtResource("12_iov5c") +expand_mode = 2 +stretch_mode = 5 + +[node name="TimeLabel" type="Label" parent="Time/HBoxContainer"] +layout_mode = 2 +theme = ExtResource("4_br77t") +text = "240 Seconds Remained" +vertical_alignment = 2 + [connection signal="pressed" from="Quit" to="." method="_on_quit_pressed"] diff --git a/Scripts/ending.gd b/Scripts/ending.gd index c5126df..3c407e5 100644 --- a/Scripts/ending.gd +++ b/Scripts/ending.gd @@ -7,13 +7,17 @@ var message: String = "" var is_win: bool = true var army: Dictionary = {} var totalBlud: float = 0 +var remainingTime: String = "0" func _ready(): if is_win: $WinningEnemy.hide() $DeadEnemy.show() $DeadEnemy.play("default") + $Time.show() + $Time/HBoxContainer/TimeLabel.text = remainingTime + " Seconds Remained" if !is_win: + $Time.hide() $WinningEnemy.show() $DeadEnemy.hide() $WinningEnemy.play("default") @@ -29,7 +33,7 @@ func _ready(): $TotalArmyComp/Separation/ArmyTotals/Wolves/AmtWolves.text = "0" if !army.has("Wolf") else str(army["Wolf"]) $TotalArmyComp/Separation/ArmyTotals/Necromancers/AmtNecromancer.text = "0" if !army.has("Necromancer") else str(army["Necromancer"]) $"TotalArmyComp/Separation/ArmyTotals/Pit Fiends/AmtPitFiend".text = "0" if !army.has("Pit Fiend") else str(army["Pit Fiend"]) - $TotalArmyComp/Separation/TotalBludGen/AmtBlud.text = str(totalBlud) + $TotalArmyComp/Separation/TotalBludGen/AmtBlud.text = str(floor(totalBlud)) func _on_quit_pressed(): get_tree().quit() diff --git a/Scripts/level.gd b/Scripts/level.gd index cf38187..00ff023 100644 --- a/Scripts/level.gd +++ b/Scripts/level.gd @@ -21,6 +21,7 @@ func _process(delta): func win_screen(): var enemy = $Enemy var end = load("res://Scenes/ending.tscn").instantiate() + end.remainingTime = str(length - time - 1) end.totalBlud = player.totalBludGenerated end.army = player.allSpawnedMonsters end.killcount = enemy.killcount From 93af389dc36a424c8aff6bb195cf979d77e15a20 Mon Sep 17 00:00:00 2001 From: Victor Turgeon Date: Wed, 11 Oct 2023 10:40:45 -0400 Subject: [PATCH 3/4] Update level.gd --- Scripts/level.gd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Scripts/level.gd b/Scripts/level.gd index 00ff023..69378f9 100644 --- a/Scripts/level.gd +++ b/Scripts/level.gd @@ -27,7 +27,7 @@ func win_screen(): end.killcount = enemy.killcount end.level = enemy.level end.exp = enemy.experience - end.message = "Fabio le chevalier est mort, bravo." + end.message = "The holy knight Fabio is defeated, Evil has won and you magic staff is safe." self.queue_free() get_tree().root.add_child(end) @@ -40,7 +40,7 @@ func lose_screen(): end.level = enemy.level end.exp = enemy.experience end.is_win = false - end.message = "Fabio le chevalier et futur roi t'a torché... royalement. (HA!)" + end.message = "The holy knight Fabio destroyed you army of evil and left with you magic staff..." self.queue_free() get_tree().root.add_child(end) From 6a6e1a51d6e93751df790a8e49078a8106f32f54 Mon Sep 17 00:00:00 2001 From: Victor Turgeon Date: Wed, 11 Oct 2023 10:42:37 -0400 Subject: [PATCH 4/4] Update level.gd --- Scripts/level.gd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Scripts/level.gd b/Scripts/level.gd index 69378f9..2eb1ec0 100644 --- a/Scripts/level.gd +++ b/Scripts/level.gd @@ -27,7 +27,7 @@ func win_screen(): end.killcount = enemy.killcount end.level = enemy.level end.exp = enemy.experience - end.message = "The holy knight Fabio is defeated, Evil has won and you magic staff is safe." + end.message = "The holy knight Fabio is defeated, Evil has won and your magic staff is safe." self.queue_free() get_tree().root.add_child(end) @@ -40,7 +40,7 @@ func lose_screen(): end.level = enemy.level end.exp = enemy.experience end.is_win = false - end.message = "The holy knight Fabio destroyed you army of evil and left with you magic staff..." + end.message = "The holy knight Fabio destroyed you army of evil and left with your magic staff..." self.queue_free() get_tree().root.add_child(end)