Small Godot Wild Jam game
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'ui-dev' into gameplay-dev

Raptor e723e081 e6f58273

+183 -1
+9
Scenes/gameplay/gameplay.tscn
··· 1 1 [gd_scene load_steps=13 format=3 uid="uid://4fyoq8npekf0"] 2 + [gd_scene load_steps=6 format=3 uid="uid://4fyoq8npekf0"] 2 3 3 4 [ext_resource type="PackedScene" uid="uid://barl4q1kugrmm" path="res://Scenes/gameplay/pause-layer/pause-layer.tscn" id="2"] 4 5 [ext_resource type="PackedScene" uid="uid://chise44bjuof6" path="res://Scenes/houses/noble_house.tscn" id="4_1f1h4"] ··· 12 13 [ext_resource type="PackedScene" uid="uid://c8ddgtyra7np7" path="res://Scenes/houses/peasant_block_1_flipped.tscn" id="8_cgywe"] 13 14 [ext_resource type="Texture2D" uid="uid://t7plj7wxdw7p" path="res://Assets/sprites/town_assets/vertical_wall.png" id="11_7ogvl"] 14 15 [ext_resource type="Texture2D" uid="uid://cflqatn1l7xa4" path="res://Assets/sprites/town_assets/gate_wall.png" id="12_7h54k"] 16 + [ext_resource type="PackedScene" uid="uid://cu4yig4opf6xt" path="res://Scenes/ui/ui.tscn" id="5_y31l6"] 15 17 16 18 [node name="Gameplay" type="Node"] 17 19 script = ExtResource("5") ··· 29 31 30 32 [node name="PauseLayer" parent="." instance=ExtResource("2")] 31 33 visible = false 34 + 35 + [node name="PossibleEventNodes" type="Node2D" parent="."] 32 36 33 37 [node name="Timers" type="Node" parent="."] 34 38 ··· 194 198 position = Vector2(-96, 1654.25) 195 199 scale = Vector2(1.45046, 1.45046) 196 200 texture = ExtResource("12_7h54k") 201 + [node name="UI" parent="." instance=ExtResource("5_y31l6")] 202 + offset_left = -640.0 203 + offset_top = -360.0 204 + offset_right = -640.0 205 + offset_bottom = -360.0 197 206 198 207 [connection signal="timeout" from="Timers/RandomEventTimer" to="." method="_on_random_event_timer_timeout"] 199 208 [connection signal="timeout" from="Timers/PopulationStatusUpdateTimer" to="." method="_on_population_status_update_timer_timeout"]
+26
Scenes/ui/ui.gd
··· 1 + extends Control 2 + 3 + #region Variables 4 + @onready var sick_people: ProgressBar = %SickPeople 5 + @onready var cured_people: ProgressBar = %CuredPeople 6 + @onready var money_counter: Label = %MoneyCounter 7 + 8 + @onready var doctor_counter: Label = %DoctorCounter 9 + @onready var priest_counter: Label = %PriestCounter 10 + 11 + @onready var dialogue_container: Control = %DialogueContainer # Will contain one dialog at a time 12 + #endregion 13 + 14 + 15 + func _ready() -> void: 16 + # Access and set the Global variables to the UI metrics 17 + sick_people.max_value = Global.population_total 18 + sick_people.value = Global.people_sick + 15 19 + 20 + cured_people.max_value = 20 # Change to cured people to win 21 + cured_people.value = Global.people_cured 22 + 23 + money_counter.text = str(Global.current_money) 24 + 25 + doctor_counter.text = str(Global.available_doctors) 26 + priest_counter.text = str(Global.available_priests)
+1
Scenes/ui/ui.gd.uid
··· 1 + uid://di6b0xk7def1x
+142
Scenes/ui/ui.tscn
··· 1 + [gd_scene load_steps=3 format=3 uid="uid://cu4yig4opf6xt"] 2 + 3 + [ext_resource type="Theme" uid="uid://ducfept6pmkkm" path="res://Resources/theme/theme-main.tres" id="1_5ldll"] 4 + [ext_resource type="Script" uid="uid://di6b0xk7def1x" path="res://Scenes/ui/ui.gd" id="1_oak0x"] 5 + 6 + [node name="UI" type="Control"] 7 + layout_mode = 3 8 + anchors_preset = 15 9 + anchor_right = 1.0 10 + anchor_bottom = 1.0 11 + grow_horizontal = 2 12 + grow_vertical = 2 13 + mouse_filter = 1 14 + script = ExtResource("1_oak0x") 15 + 16 + [node name="CanvasLayer" type="CanvasLayer" parent="."] 17 + 18 + [node name="Metrics" type="HBoxContainer" parent="CanvasLayer"] 19 + anchors_preset = 1 20 + anchor_left = 1.0 21 + anchor_right = 1.0 22 + offset_left = -416.0 23 + offset_bottom = 100.0 24 + grow_horizontal = 0 25 + mouse_filter = 2 26 + theme_override_constants/separation = 36 27 + alignment = 2 28 + 29 + [node name="VBoxContainer" type="VBoxContainer" parent="CanvasLayer/Metrics"] 30 + layout_mode = 2 31 + alignment = 1 32 + 33 + [node name="HBoxContainer" type="HBoxContainer" parent="CanvasLayer/Metrics/VBoxContainer"] 34 + layout_mode = 2 35 + theme_override_constants/separation = 16 36 + 37 + [node name="VBoxContainer" type="VBoxContainer" parent="CanvasLayer/Metrics/VBoxContainer/HBoxContainer"] 38 + layout_mode = 2 39 + 40 + [node name="Label" type="Label" parent="CanvasLayer/Metrics/VBoxContainer/HBoxContainer/VBoxContainer"] 41 + layout_mode = 2 42 + text = "Sick" 43 + horizontal_alignment = 1 44 + 45 + [node name="SickPeople" type="ProgressBar" parent="CanvasLayer/Metrics/VBoxContainer/HBoxContainer/VBoxContainer"] 46 + unique_name_in_owner = true 47 + custom_minimum_size = Vector2(128, 32) 48 + layout_mode = 2 49 + theme = ExtResource("1_5ldll") 50 + step = 1.0 51 + value = 50.0 52 + 53 + [node name="VBoxContainer2" type="VBoxContainer" parent="CanvasLayer/Metrics/VBoxContainer/HBoxContainer"] 54 + layout_mode = 2 55 + 56 + [node name="Label2" type="Label" parent="CanvasLayer/Metrics/VBoxContainer/HBoxContainer/VBoxContainer2"] 57 + layout_mode = 2 58 + text = "Cured" 59 + horizontal_alignment = 1 60 + 61 + [node name="CuredPeople" type="ProgressBar" parent="CanvasLayer/Metrics/VBoxContainer/HBoxContainer/VBoxContainer2"] 62 + unique_name_in_owner = true 63 + custom_minimum_size = Vector2(128, 32) 64 + layout_mode = 2 65 + theme = ExtResource("1_5ldll") 66 + step = 1.0 67 + value = 50.0 68 + 69 + [node name="MoneyVbox" type="VBoxContainer" parent="CanvasLayer/Metrics"] 70 + layout_mode = 2 71 + 72 + [node name="MoneyLabel" type="Label" parent="CanvasLayer/Metrics/MoneyVbox"] 73 + custom_minimum_size = Vector2(48, 48) 74 + layout_mode = 2 75 + theme = ExtResource("1_5ldll") 76 + text = "MONEY" 77 + horizontal_alignment = 1 78 + vertical_alignment = 2 79 + 80 + [node name="MoneyCounter" type="Label" parent="CanvasLayer/Metrics/MoneyVbox"] 81 + unique_name_in_owner = true 82 + custom_minimum_size = Vector2(48, 48) 83 + layout_mode = 2 84 + theme = ExtResource("1_5ldll") 85 + text = "[num]" 86 + horizontal_alignment = 1 87 + vertical_alignment = 1 88 + 89 + [node name="MarginContainer" type="MarginContainer" parent="CanvasLayer/Metrics"] 90 + layout_mode = 2 91 + 92 + [node name="AvailableDoctorsPriestsCounters" type="HBoxContainer" parent="CanvasLayer"] 93 + custom_minimum_size = Vector2(0, 100) 94 + offset_right = 40.0 95 + offset_bottom = 40.0 96 + theme_override_constants/separation = 36 97 + 98 + [node name="MarginContainer2" type="MarginContainer" parent="CanvasLayer/AvailableDoctorsPriestsCounters"] 99 + layout_mode = 2 100 + 101 + [node name="Doctors" type="VBoxContainer" parent="CanvasLayer/AvailableDoctorsPriestsCounters"] 102 + layout_mode = 2 103 + alignment = 1 104 + 105 + [node name="Label" type="Label" parent="CanvasLayer/AvailableDoctorsPriestsCounters/Doctors"] 106 + layout_mode = 2 107 + text = "Doctors" 108 + horizontal_alignment = 1 109 + vertical_alignment = 2 110 + 111 + [node name="DoctorCounter" type="Label" parent="CanvasLayer/AvailableDoctorsPriestsCounters/Doctors"] 112 + unique_name_in_owner = true 113 + layout_mode = 2 114 + text = "[num]" 115 + horizontal_alignment = 1 116 + 117 + [node name="Priests" type="VBoxContainer" parent="CanvasLayer/AvailableDoctorsPriestsCounters"] 118 + layout_mode = 2 119 + alignment = 1 120 + 121 + [node name="Label" type="Label" parent="CanvasLayer/AvailableDoctorsPriestsCounters/Priests"] 122 + layout_mode = 2 123 + text = "Priests" 124 + horizontal_alignment = 1 125 + 126 + [node name="PriestCounter" type="Label" parent="CanvasLayer/AvailableDoctorsPriestsCounters/Priests"] 127 + unique_name_in_owner = true 128 + layout_mode = 2 129 + text = "[num]" 130 + horizontal_alignment = 1 131 + 132 + [node name="DialogueContainer" type="Control" parent="CanvasLayer"] 133 + unique_name_in_owner = true 134 + custom_minimum_size = Vector2(0, 192) 135 + layout_mode = 3 136 + anchors_preset = 12 137 + anchor_top = 1.0 138 + anchor_right = 1.0 139 + anchor_bottom = 1.0 140 + grow_horizontal = 2 141 + grow_vertical = 0 142 + size_flags_vertical = 4
+5 -1
Scripts/global.gd
··· 1 1 extends Node 2 2 3 + #region Varaibles 3 4 var debug_mode: bool = true 4 5 var rng := RandomNumberGenerator.new() 5 6 ··· 7 8 var population_total: int = 150 8 9 var people_cured: int = 0 9 10 var people_sick: int = 0 10 - var available_units: int = 0 11 + 12 + var available_doctors: int = 2 13 + var available_priests: int = 3 11 14 12 15 enum UnitType {DOCTOR, PRIEST} 16 + #endregion 13 17 14 18 func _init() -> void: 15 19 Console.register_custom_command("debug", _toggle_debug_mode)