Changes to make it work with godot 4.4.

pull/18/head
jc-stemuli 2025-04-15 10:19:18 +07:00
parent 285781d312
commit 1fb0c69d6c
108 changed files with 1038 additions and 159 deletions

@ -0,0 +1,3 @@
{
"godotTools.editorPath.godot4": "c:\\Users\\jason\\Downloads\\Godot_v4.4.1-stable_mono_win64\\Godot_v4.4.1-stable_mono_win64\\Godot_v4.4.1-stable_mono_win64.exe"
}

@ -23,6 +23,7 @@ allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=1
keep_rounding_remainders=true
oversampling=0.0
Fallbacks=null
fallbacks=[]

@ -1,7 +1,7 @@
[gd_resource type="Resource" script_class="MissionData" load_steps=4 format=3 uid="uid://p3xwn2mp6bm6"]
[ext_resource type="Script" path="res://scripts/mission/mission_objective.gd" id="1_dhx01"]
[ext_resource type="Script" path="res://scripts/mission/mission_data.gd" id="2_mum3p"]
[ext_resource type="Script" uid="uid://c7v1kbo5amrko" path="res://scripts/mission/mission_objective.gd" id="1_dhx01"]
[ext_resource type="Script" uid="uid://c6f12a8vs3hp6" path="res://scripts/mission/mission_data.gd" id="2_mum3p"]
[sub_resource type="Resource" id="Resource_c06be"]
script = ExtResource("1_dhx01")

@ -1,7 +1,7 @@
[gd_resource type="Resource" script_class="MissionData" load_steps=4 format=3 uid="uid://x5h4xutbldq3"]
[ext_resource type="Script" path="res://scripts/mission/mission_data.gd" id="1_nv6c6"]
[ext_resource type="Script" path="res://scripts/mission/mission_objective.gd" id="1_yfbrc"]
[ext_resource type="Script" uid="uid://c6f12a8vs3hp6" path="res://scripts/mission/mission_data.gd" id="1_nv6c6"]
[ext_resource type="Script" uid="uid://c7v1kbo5amrko" path="res://scripts/mission/mission_objective.gd" id="1_yfbrc"]
[sub_resource type="Resource" id="Resource_ywws1"]
script = ExtResource("1_yfbrc")

@ -1,7 +1,7 @@
[gd_resource type="Resource" script_class="MissionData" load_steps=4 format=3 uid="uid://bho4qh41asyk1"]
[ext_resource type="Script" path="res://scripts/mission/mission_objective.gd" id="1_dhx01"]
[ext_resource type="Script" path="res://scripts/mission/mission_data.gd" id="2_mum3p"]
[ext_resource type="Script" uid="uid://c7v1kbo5amrko" path="res://scripts/mission/mission_objective.gd" id="1_dhx01"]
[ext_resource type="Script" uid="uid://c6f12a8vs3hp6" path="res://scripts/mission/mission_data.gd" id="2_mum3p"]
[sub_resource type="Resource" id="Resource_c06be"]
script = ExtResource("1_dhx01")

@ -1,7 +1,7 @@
[gd_resource type="Resource" script_class="MissionData" load_steps=4 format=3 uid="uid://cjr36hqnmyn0x"]
[ext_resource type="Script" path="res://scripts/mission/mission_objective.gd" id="1_dhx01"]
[ext_resource type="Script" path="res://scripts/mission/mission_data.gd" id="2_mum3p"]
[ext_resource type="Script" uid="uid://c7v1kbo5amrko" path="res://scripts/mission/mission_objective.gd" id="1_dhx01"]
[ext_resource type="Script" uid="uid://c6f12a8vs3hp6" path="res://scripts/mission/mission_data.gd" id="2_mum3p"]
[sub_resource type="Resource" id="Resource_7c02e"]
script = ExtResource("1_dhx01")

@ -1,7 +1,7 @@
[gd_resource type="Resource" script_class="MissionData" load_steps=4 format=3 uid="uid://bv4r7ebpjdce4"]
[ext_resource type="Script" path="res://scripts/mission/mission_objective.gd" id="1_nxtw6"]
[ext_resource type="Script" path="res://scripts/mission/mission_data.gd" id="2_83mjp"]
[ext_resource type="Script" uid="uid://c7v1kbo5amrko" path="res://scripts/mission/mission_objective.gd" id="1_nxtw6"]
[ext_resource type="Script" uid="uid://c6f12a8vs3hp6" path="res://scripts/mission/mission_data.gd" id="2_83mjp"]
[sub_resource type="Resource" id="Resource_power_plant"]
script = ExtResource("1_nxtw6")

@ -1,7 +1,7 @@
[gd_resource type="Resource" script_class="MissionData" load_steps=4 format=3 uid="uid://dykbopx8n3c3v"]
[ext_resource type="Script" path="res://scripts/mission/mission_objective.gd" id="1_l3spi"]
[ext_resource type="Script" path="res://scripts/mission/mission_data.gd" id="2_b4llw"]
[ext_resource type="Script" uid="uid://c7v1kbo5amrko" path="res://scripts/mission/mission_objective.gd" id="1_l3spi"]
[ext_resource type="Script" uid="uid://c6f12a8vs3hp6" path="res://scripts/mission/mission_data.gd" id="2_b4llw"]
[sub_resource type="Resource" id="Resource_c06be"]
script = ExtResource("1_l3spi")

@ -18,6 +18,7 @@ nodes/root_name="Scene Root"
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

@ -18,6 +18,7 @@ nodes/root_name="Scene Root"
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

@ -18,6 +18,7 @@ nodes/root_name="Scene Root"
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

@ -18,6 +18,7 @@ nodes/root_name="Scene Root"
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

@ -18,6 +18,7 @@ nodes/root_name="Scene Root"
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

@ -18,6 +18,7 @@ nodes/root_name="Scene Root"
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

@ -18,6 +18,7 @@ nodes/root_name="Scene Root"
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

@ -18,6 +18,7 @@ nodes/root_name="Scene Root"
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

@ -18,6 +18,7 @@ nodes/root_name="Scene Root"
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

@ -18,6 +18,7 @@ nodes/root_name="Scene Root"
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

@ -18,6 +18,7 @@ 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

@ -18,6 +18,7 @@ nodes/root_name="Scene Root"
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

@ -18,6 +18,7 @@ nodes/root_name="Scene Root"
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

@ -18,6 +18,7 @@ nodes/root_name="Scene Root"
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

@ -18,6 +18,7 @@ nodes/root_name="Scene Root"
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

@ -18,6 +18,7 @@ nodes/root_name="Scene Root"
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
@ -38,8 +39,7 @@ _subresources={
"generate/lods": 0,
"generate/shadow_meshes": 0,
"lods/normal_merge_angle": 60.0,
"lods/normal_split_angle": 25.0,
"save_to_file/enabled": true,
"save_to_file/enabled": false,
"save_to_file/path": "res://mesges/road-mesh.res"
}
}

@ -18,6 +18,7 @@ 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

@ -18,6 +18,7 @@ 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

@ -18,6 +18,7 @@ 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

@ -18,6 +18,7 @@ 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

@ -18,6 +18,7 @@ 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

@ -18,6 +18,7 @@ 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

@ -18,6 +18,7 @@ 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

@ -18,6 +18,7 @@ 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

@ -13,7 +13,7 @@ config_version=5
config/name="Starter Kit City Builder"
config/tags=PackedStringArray("starterkit")
run/main_scene="res://scenes/main.tscn"
config/features=PackedStringArray("4.3", "Forward Plus")
config/features=PackedStringArray("4.4", "Forward Plus")
boot_splash/bg_color=Color(0.92549, 0.92549, 0.960784, 1)
boot_splash/image="res://splash-screen.png"
config/icon="res://icon.png"

Binary file not shown.

@ -1,6 +1,6 @@
[gd_scene load_steps=5 format=3 uid="uid://b8ne7pqtnju2y"]
[ext_resource type="Script" uid="uid://dsdxor1cwpqp" path="res://sample/UpdateLatex.gd" id="2"]
[ext_resource type="Script" uid="uid://dvs8h3w31nbty" path="res://sample/UpdateLatex.gd" id="2"]
[sub_resource type="Image" id="Image_0hed4"]
data = {

@ -1,7 +1,7 @@
[gd_scene load_steps=3 format=3 uid="uid://ib2t48fgsw62"]
[ext_resource type="FontFile" uid="uid://d0cxd77jybrcn" path="res://fonts/lilita_one_regular.ttf" id="1_ncwjb"]
[ext_resource type="Script" uid="uid://dsdnejv05yxyb" path="res://scripts/attribution_screen.gd" id="1_qwu4y"]
[ext_resource type="Script" uid="uid://b1014mouu2vqu" path="res://scripts/attribution_screen.gd" id="1_qwu4y"]
[node name="AttributionScreen" type="CanvasLayer"]
script = ExtResource("1_qwu4y")

@ -1,6 +1,6 @@
[gd_scene load_steps=8 format=3 uid="uid://b4gkfwf4i3ydl"]
[ext_resource type="Script" uid="uid://c2u81fdo7uou3" path="res://scripts/mission/character_controller.gd" id="1_g3a7y"]
[ext_resource type="Script" uid="uid://dexknr7it5val" path="res://scripts/mission/character_controller.gd" id="1_g3a7y"]
[ext_resource type="PackedScene" uid="uid://h2jjkvc4edsp" path="res://people/character-female-d.glb" id="2_d5jmi"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_b4w3n"]

@ -1,7 +1,7 @@
[gd_scene load_steps=4 format=3 uid="uid://7aqckirt7b41"]
[ext_resource type="PackedScene" uid="uid://h2jjkvc4edsp" path="res://people/character-female-d.glb" id="1_anb25"]
[ext_resource type="Script" uid="uid://88a6avyptj0n" path="res://scripts/NavigationNPC.gd" id="1_eug4x"]
[ext_resource type="Script" uid="uid://buvxhq2ipa8gt" path="res://scripts/NavigationNPC.gd" id="1_eug4x"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_8rf01"]
radius = 0.307771

@ -1,7 +1,7 @@
[gd_scene load_steps=4 format=3 uid="uid://bqjnp7uypupog"]
[ext_resource type="FontFile" uid="uid://d0cxd77jybrcn" path="res://fonts/lilita_one_regular.ttf" id="1_tnlhn"]
[ext_resource type="Script" path="res://scripts/controls_panel.gd" id="1_xyuqg"]
[ext_resource type="Script" uid="uid://b2vlnidm83s8y" path="res://scripts/controls_panel.gd" id="1_xyuqg"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_f2mso"]
bg_color = Color(0.145098, 0.172549, 0.231373, 0.941176)

@ -89,4 +89,4 @@ autowrap_mode = 2
layout_mode = 2
theme_override_colors/font_color = Color(1, 0, 0, 1)
theme_override_font_sizes/font_size = 20
text = "CLOSE"
text = "CLOSE"

@ -1,6 +1,6 @@
[gd_scene load_steps=4 format=3 uid="uid://cq1w6ovisjgsg"]
[ext_resource type="Script" uid="uid://w2g0h4c8ymo4" path="res://scripts/mission/fullscreen_learning_panel.gd" id="1_kq0jb"]
[ext_resource type="Script" uid="uid://d4isuuaa51b7x" path="res://scripts/mission/fullscreen_learning_panel.gd" id="1_kq0jb"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxFlat_empty"]

@ -0,0 +1 @@
uid://c7qrkyfuarnfa

@ -1,6 +1,6 @@
[gd_scene load_steps=4 format=3 uid="uid://dmsy06s02tcw4"]
[ext_resource type="Script" path="res://scenes/generic_text.gd" id="1_qcnox"]
[ext_resource type="Script" uid="uid://c7qrkyfuarnfa" path="res://scenes/generic_text.gd" id="1_qcnox"]
[ext_resource type="FontFile" uid="uid://d0cxd77jybrcn" path="res://fonts/lilita_one_regular.ttf" id="2_7oj77"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_f2mso"]

@ -1,6 +1,6 @@
[gd_scene load_steps=10 format=3 uid="uid://cgk66f6rg03mj"]
[ext_resource type="Script" path="res://scripts/hud_manager.gd" id="1_6vdxc"]
[ext_resource type="Script" uid="uid://caabw5op0u6tc" path="res://scripts/hud_manager.gd" id="1_6vdxc"]
[ext_resource type="Texture2D" uid="uid://hendpftbt4iw" path="res://sprites/population_icon.png" id="2_28oy1"]
[ext_resource type="Texture2D" uid="uid://jk3mremfu7lm" path="res://sprites/electricity_icon.png" id="3_2u5bk"]
[ext_resource type="FontFile" uid="uid://d0cxd77jybrcn" path="res://fonts/lilita_one_regular.ttf" id="4_qfmf5"]

@ -1,6 +1,7 @@
[gd_scene load_steps=2 format=3 uid="uid://bb04k2hkfmls6"]
[ext_resource type="Script" path="res://scripts/mission/improved_unlocked_panel.gd" id="1_r3fws"]
[sub_resource type="Resource" id="Resource_0aveo"]
metadata/__load_path__ = "res://scripts/mission/improved_unlocked_panel.gd"
[node name="ImprovedUnlockedPanel" type="Control"]
layout_mode = 3
@ -9,7 +10,7 @@ anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_r3fws")
script = SubResource("Resource_0aveo")
[node name="ColorRect" type="ColorRect" parent="."]
layout_mode = 1
@ -66,4 +67,4 @@ size_flags_vertical = 3
layout_mode = 2
text = "Close"
[connection signal="pressed" from="PanelContainer/MarginContainer/VBoxContainer/CloseButton" to="." method="_on_close_button_pressed"]
[connection signal="pressed" from="PanelContainer/MarginContainer/VBoxContainer/CloseButton" to="." method="_on_close_button_pressed"]

@ -1,6 +1,6 @@
[gd_scene load_steps=5 format=3 uid="uid://ceae06aaigfhh"]
[ext_resource type="Script" path="res://scripts/mission/learning_panel.gd" id="1_wn8yp"]
[ext_resource type="Script" uid="uid://52tdmmosdbpa" path="res://scripts/mission/learning_panel.gd" id="1_wn8yp"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxFlat_empty"]

@ -1,19 +1,19 @@
[gd_scene load_steps=33 format=3 uid="uid://vgwrcfy1qawf"]
[ext_resource type="Script" path="res://scripts/builder.gd" id="1_jybm7"]
[ext_resource type="Script" uid="uid://snp3i7itqnqc" path="res://scripts/builder.gd" id="1_jybm7"]
[ext_resource type="Environment" uid="uid://jbptgqvstei3" path="res://scenes/main-environment.tres" id="1_yndf3"]
[ext_resource type="Script" path="res://scripts/structure.gd" id="2_54v6r"]
[ext_resource type="Script" uid="uid://cw0jlq5d8r66g" path="res://scripts/structure.gd" id="2_54v6r"]
[ext_resource type="Resource" uid="uid://dv14kkhb6umkv" path="res://structures/road-straight.tres" id="2_bwyku"]
[ext_resource type="Texture2D" uid="uid://cbk07cxgshg26" path="res://sprites/selector.png" id="4_wr1wv"]
[ext_resource type="Resource" uid="uid://cntgl86ianngh" path="res://structures/building-small-a.tres" id="5_v5o2m"]
[ext_resource type="Resource" uid="uid://ccb475jeg7ym5" path="res://structures/grass-trees.tres" id="6_fwsy4"]
[ext_resource type="Script" path="res://scripts/view.gd" id="8_yovpv"]
[ext_resource type="Script" path="res://scripts/mission/mission_manager.gd" id="10_oe3re"]
[ext_resource type="Script" uid="uid://cu76h00erned0" path="res://scripts/view.gd" id="8_yovpv"]
[ext_resource type="Script" uid="uid://bnpqjt5n1s20m" path="res://scripts/mission/mission_manager.gd" id="10_oe3re"]
[ext_resource type="PackedScene" uid="uid://dmsy06s02tcw4" path="res://scenes/generic_text_panel.tscn" id="13_7i6dj"]
[ext_resource type="Script" path="res://scripts/mission/mission_ui.gd" id="13_xvw5w"]
[ext_resource type="Script" path="res://resources/generic_text_panel.resource.gd" id="14_76jlq"]
[ext_resource type="Script" path="res://scripts/mission/learning_panel.gd" id="14_q2ymb"]
[ext_resource type="Script" path="res://scripts/mission/mission_data.gd" id="14_vcrh8"]
[ext_resource type="Script" uid="uid://bxuxhmlcqp64g" path="res://scripts/mission/mission_ui.gd" id="13_xvw5w"]
[ext_resource type="Script" uid="uid://d1rme8o0ewiet" path="res://resources/generic_text_panel.resource.gd" id="14_76jlq"]
[ext_resource type="Script" uid="uid://52tdmmosdbpa" path="res://scripts/mission/learning_panel.gd" id="14_q2ymb"]
[ext_resource type="Script" uid="uid://c6f12a8vs3hp6" path="res://scripts/mission/mission_data.gd" id="14_vcrh8"]
[ext_resource type="Resource" uid="uid://x5h4xutbldq3" path="res://mission/first_mission.tres" id="15_obmwc"]
[ext_resource type="Resource" uid="uid://cjr36hqnmyn0x" path="res://mission/second_mission.tres" id="16_rl54y"]
[ext_resource type="Resource" uid="uid://dykbopx8n3c3v" path="res://mission/third_mission.tres" id="17_rrdy6"]
@ -23,7 +23,7 @@
[ext_resource type="PackedScene" uid="uid://cgk66f6rg03mj" path="res://scenes/hud.tscn" id="18_hud"]
[ext_resource type="PackedScene" uid="uid://bqjnp7uypupog" path="res://scenes/controls_panel.tscn" id="19_controls"]
[ext_resource type="Resource" uid="uid://p3xwn2mp6bm6" path="res://mission/fifth_mission.tres" id="19_e8sub"]
[ext_resource type="Script" path="res://scripts/game_manager.gd" id="20_game_manager"]
[ext_resource type="Script" uid="uid://dlqco4kmwr3er" path="res://scripts/game_manager.gd" id="20_game_manager"]
[ext_resource type="Resource" uid="uid://bv4r7ebpjdce4" path="res://mission/sixth_mission.tres" id="20_r0ysx"]
[ext_resource type="PackedScene" uid="uid://b4s46k58ddpyc" path="res://scenes/sound_panel.tscn" id="21_sound_panel"]

@ -0,0 +1,365 @@
[gd_scene load_steps=33 format=3 uid="uid://vgwrcfy1qawf"]
[ext_resource type="Script" uid="uid://snp3i7itqnqc" path="res://scripts/builder.gd" id="1_jybm7"]
[ext_resource type="Environment" uid="uid://jbptgqvstei3" path="res://scenes/main-environment.tres" id="1_yndf3"]
[ext_resource type="Script" uid="uid://cw0jlq5d8r66g" path="res://scripts/structure.gd" id="2_54v6r"]
[ext_resource type="Resource" uid="uid://dv14kkhb6umkv" path="res://structures/road-straight.tres" id="2_bwyku"]
[ext_resource type="Texture2D" uid="uid://cbk07cxgshg26" path="res://sprites/selector.png" id="4_wr1wv"]
[ext_resource type="Resource" uid="uid://cntgl86ianngh" path="res://structures/building-small-a.tres" id="5_v5o2m"]
[ext_resource type="Resource" uid="uid://ccb475jeg7ym5" path="res://structures/grass-trees.tres" id="6_fwsy4"]
[ext_resource type="Script" uid="uid://cu76h00erned0" path="res://scripts/view.gd" id="8_yovpv"]
[ext_resource type="Script" uid="uid://bnpqjt5n1s20m" path="res://scripts/mission/mission_manager.gd" id="10_oe3re"]
[ext_resource type="PackedScene" uid="uid://dmsy06s02tcw4" path="res://scenes/generic_text_panel.tscn" id="13_7i6dj"]
[ext_resource type="Script" uid="uid://bxuxhmlcqp64g" path="res://scripts/mission/mission_ui.gd" id="13_xvw5w"]
[ext_resource type="Script" uid="uid://d1rme8o0ewiet" path="res://resources/generic_text_panel.resource.gd" id="14_76jlq"]
[ext_resource type="Script" uid="uid://52tdmmosdbpa" path="res://scripts/mission/learning_panel.gd" id="14_q2ymb"]
[ext_resource type="Script" uid="uid://c6f12a8vs3hp6" path="res://scripts/mission/mission_data.gd" id="14_vcrh8"]
[ext_resource type="Resource" uid="uid://x5h4xutbldq3" path="res://mission/first_mission.tres" id="15_obmwc"]
[ext_resource type="Resource" uid="uid://cjr36hqnmyn0x" path="res://mission/second_mission.tres" id="16_rl54y"]
[ext_resource type="Resource" uid="uid://dykbopx8n3c3v" path="res://mission/third_mission.tres" id="17_rrdy6"]
[ext_resource type="FontFile" uid="uid://d0cxd77jybrcn" path="res://fonts/lilita_one_regular.ttf" id="17_vlub6"]
[ext_resource type="PackedScene" uid="uid://b4gkfwf4i3ydl" path="res://scenes/character.tscn" id="18_8lrh8"]
[ext_resource type="Resource" uid="uid://bho4qh41asyk1" path="res://mission/fourth_mission.tres" id="18_h4fpv"]
[ext_resource type="PackedScene" uid="uid://cgk66f6rg03mj" path="res://scenes/hud.tscn" id="18_hud"]
[ext_resource type="PackedScene" uid="uid://bqjnp7uypupog" path="res://scenes/controls_panel.tscn" id="19_controls"]
[ext_resource type="Resource" uid="uid://p3xwn2mp6bm6" path="res://mission/fifth_mission.tres" id="19_e8sub"]
[ext_resource type="Script" uid="uid://dlqco4kmwr3er" path="res://scripts/game_manager.gd" id="20_game_manager"]
[ext_resource type="Resource" uid="uid://bv4r7ebpjdce4" path="res://mission/sixth_mission.tres" id="20_r0ysx"]
[ext_resource type="PackedScene" uid="uid://b4s46k58ddpyc" path="res://scenes/sound_panel.tscn" id="21_sound_panel"]
[sub_resource type="Resource" id="Resource_1gdbm"]
script = ExtResource("14_76jlq")
panel_type = 0
title = "Welcome to Stem City "
body_text = "Hi League Community,
Your goal is to build a thriving community from the ground up. As you complete missions, you'll unlock new structures to expand and improve your city.
Each mission introduces important Math concepts used in urban planning and city management. You'll apply mathematics while watching your city grow.
You are the very first group of students who get to test this. So keep in mind there will be bugs, but do note them.
We are aware of the following bugs:
- Population count may be off by 1
- Lighting Baking in Web Builds are too bright
- We don't restrict building off of roads which will cause workers not to reach buildings
- Building overlap
- No builders for Power Plant
Ready to start planning your city? Click Close to see the controls and begin your first mission!
"
button_text = "Close"
[sub_resource type="Resource" id="Resource_ja86h"]
script = ExtResource("14_76jlq")
panel_type = 1
title = "Welcome to Stem City"
body_text = "Congratulations, City Planner!
You've completed all the guided missions and unlocked the full potential of Stem City. Your understanding of urban planning and STEM concepts has helped create a thriving community.
But the journey doesn't end here! Continue expanding your city using all the structures you've unlocked. Experiment with different layouts, create new neighborhoods, and see how large you can grow your population.
The future of Stem City is now in your hands - keep building and exploring!
"
button_text = "Close"
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_mission"]
bg_color = Color(0.145098, 0.172549, 0.231373, 0.941176)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(0.356863, 0.670588, 0.768627, 1)
corner_radius_top_left = 8
corner_radius_top_right = 8
corner_radius_bottom_right = 8
corner_radius_bottom_left = 8
shadow_size = 5
shadow_offset = Vector2(2, 2)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_lsmd5"]
bg_color = Color(0.196078, 0.196078, 0.196078, 0.960784)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(0.294118, 0.478431, 0.729412, 1)
corner_radius_top_left = 8
corner_radius_top_right = 8
corner_radius_bottom_right = 8
corner_radius_bottom_left = 8
shadow_size = 5
shadow_offset = Vector2(3, 3)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_description"]
bg_color = Color(0.145098, 0.145098, 0.164706, 0.768627)
border_width_left = 1
border_width_top = 1
border_width_right = 1
border_width_bottom = 1
border_color = Color(0.294118, 0.478431, 0.729412, 0.301961)
corner_radius_top_left = 4
corner_radius_top_right = 4
corner_radius_bottom_right = 4
corner_radius_bottom_left = 4
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_graph"]
bg_color = Color(0.117647, 0.137255, 0.160784, 0.768627)
border_width_left = 1
border_width_top = 1
border_width_right = 1
border_width_bottom = 1
border_color = Color(0.294118, 0.478431, 0.729412, 0.301961)
corner_radius_top_left = 4
corner_radius_top_right = 4
corner_radius_bottom_right = 4
corner_radius_bottom_left = 4
[node name="Main" type="Node3D"]
script = ExtResource("20_game_manager")
intro_text_resource = SubResource("Resource_1gdbm")
outro_text_resource = SubResource("Resource_ja86h")
[node name="Builder" type="Node3D" parent="." node_paths=PackedStringArray("selector", "selector_container", "view_camera", "gridmap", "cash_display")]
script = ExtResource("1_jybm7")
structures = Array[ExtResource("2_54v6r")]([ExtResource("2_bwyku"), ExtResource("5_v5o2m"), ExtResource("6_fwsy4")])
selector = NodePath("Selector")
selector_container = NodePath("Selector/Container")
view_camera = NodePath("../View/Camera")
gridmap = NodePath("../GridMap")
cash_display = NodePath("../CanvasLayer/HUD/HBoxContainer/CashItem/CashLabel")
[node name="Selector" type="Node3D" parent="Builder"]
[node name="Sprite" type="Sprite3D" parent="Builder/Selector"]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0.06, 0)
texture = ExtResource("4_wr1wv")
[node name="Container" type="Node3D" parent="Builder/Selector"]
[node name="View" type="Node3D" parent="."]
transform = Transform3D(0.707107, -0.40558, 0.579228, 0, 0.819152, 0.573576, -0.707107, -0.40558, 0.579228, 0, 0, 0)
script = ExtResource("8_yovpv")
[node name="Camera" type="Camera3D" parent="View"]
transform = Transform3D(1, 0, 0, 0, 1, 7.15256e-07, 0, 0, 1, 0, 27.98, 49.5918)
environment = ExtResource("1_yndf3")
fov = 20.0
[node name="GridMap" type="GridMap" parent="."]
cell_size = Vector3(1, 1, 1)
cell_center_x = false
cell_center_y = false
cell_center_z = false
[node name="Sun" type="DirectionalLight3D" parent="."]
transform = Transform3D(-0.422618, -0.694272, 0.582563, 0, 0.642788, 0.766044, -0.906308, 0.323744, -0.271654, 0, 0, 0)
shadow_enabled = true
shadow_opacity = 0.75
[node name="CanvasLayer" type="CanvasLayer" parent="."]
[node name="HUD" parent="CanvasLayer" instance=ExtResource("18_hud")]
[node name="ControlsPanel" parent="CanvasLayer" instance=ExtResource("19_controls")]
[node name="SoundPanel" parent="CanvasLayer" instance=ExtResource("21_sound_panel")]
anchors_preset = 8
[node name="GenericTextPanel" parent="CanvasLayer" instance=ExtResource("13_7i6dj")]
resource_data = ExtResource("14_76jlq")
[node name="MissionManager" type="Node" parent="." node_paths=PackedStringArray("mission_ui", "builder")]
script = ExtResource("10_oe3re")
missions = Array[ExtResource("14_vcrh8")]([ExtResource("15_obmwc"), ExtResource("16_rl54y"), ExtResource("17_rrdy6"), ExtResource("18_h4fpv"), ExtResource("19_e8sub"), ExtResource("20_r0ysx")])
mission_ui = NodePath("MissionPanel")
builder = NodePath("../Builder")
character_scene = ExtResource("18_8lrh8")
[node name="MissionPanel" type="PanelContainer" parent="MissionManager" node_paths=PackedStringArray("mission_title_label", "mission_description_label", "objectives_container")]
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -450.0
offset_top = 20.0
offset_right = -20.0
grow_horizontal = 0
size_flags_vertical = 0
theme_override_styles/panel = SubResource("StyleBoxFlat_mission")
script = ExtResource("13_xvw5w")
mission_title_label = NodePath("MarginContainer/VBoxContainer/MissionTitleLabel")
mission_description_label = NodePath("MarginContainer/VBoxContainer/MissionDescriptionLabel")
objectives_container = NodePath("MarginContainer/VBoxContainer/ObjectivesContainer")
[node name="MarginContainer" type="MarginContainer" parent="MissionManager/MissionPanel"]
layout_mode = 2
theme_override_constants/margin_left = 20
theme_override_constants/margin_top = 20
theme_override_constants/margin_right = 20
theme_override_constants/margin_bottom = 20
[node name="VBoxContainer" type="VBoxContainer" parent="MissionManager/MissionPanel/MarginContainer"]
layout_mode = 2
size_flags_vertical = 3
theme_override_constants/separation = 15
[node name="MissionTitleLabel" type="Label" parent="MissionManager/MissionPanel/MarginContainer/VBoxContainer"]
layout_mode = 2
theme_override_fonts/font = ExtResource("17_vlub6")
theme_override_font_sizes/font_size = 24
text = "Mission Title"
horizontal_alignment = 1
[node name="HSeparator" type="HSeparator" parent="MissionManager/MissionPanel/MarginContainer/VBoxContainer"]
layout_mode = 2
[node name="MissionDescriptionLabel" type="Label" parent="MissionManager/MissionPanel/MarginContainer/VBoxContainer"]
layout_mode = 2
size_flags_vertical = 1
theme_override_font_sizes/font_size = 16
text = "Mission description goes here..."
autowrap_mode = 2
text_overrun_behavior = 4
[node name="HSeparator2" type="HSeparator" parent="MissionManager/MissionPanel/MarginContainer/VBoxContainer"]
layout_mode = 2
[node name="ObjectivesLabel" type="Label" parent="MissionManager/MissionPanel/MarginContainer/VBoxContainer"]
layout_mode = 2
theme_override_colors/font_color = Color(0.678431, 0.847059, 1, 1)
theme_override_font_sizes/font_size = 18
text = "Objectives:"
[node name="ObjectivesContainer" type="VBoxContainer" parent="MissionManager/MissionPanel/MarginContainer/VBoxContainer"]
layout_mode = 2
size_flags_vertical = 3
theme_override_constants/separation = 10
[node name="LearningPanel" type="PanelContainer" parent="MissionManager"]
visible = false
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 50.0
offset_top = 50.0
offset_right = -50.0
offset_bottom = -50.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme_override_styles/panel = SubResource("StyleBoxFlat_lsmd5")
script = ExtResource("14_q2ymb")
[node name="MarginContainer" type="MarginContainer" parent="MissionManager/LearningPanel"]
layout_mode = 2
theme_override_constants/margin_left = 30
theme_override_constants/margin_top = 30
theme_override_constants/margin_right = 30
theme_override_constants/margin_bottom = 30
[node name="VBoxContainer" type="VBoxContainer" parent="MissionManager/LearningPanel/MarginContainer"]
layout_mode = 2
size_flags_vertical = 3
theme_override_constants/separation = 20
[node name="TitleLabel" type="Label" parent="MissionManager/LearningPanel/MarginContainer/VBoxContainer"]
layout_mode = 2
theme_override_fonts/font = ExtResource("17_vlub6")
theme_override_font_sizes/font_size = 32
text = "Learning Module"
horizontal_alignment = 1
[node name="HSeparator" type="HSeparator" parent="MissionManager/LearningPanel/MarginContainer/VBoxContainer"]
layout_mode = 2
[node name="DescriptionPanel" type="PanelContainer" parent="MissionManager/LearningPanel/MarginContainer/VBoxContainer"]
layout_mode = 2
size_flags_vertical = 3
size_flags_stretch_ratio = 0.5
theme_override_styles/panel = SubResource("StyleBoxFlat_description")
[node name="MarginContainer" type="MarginContainer" parent="MissionManager/LearningPanel/MarginContainer/VBoxContainer/DescriptionPanel"]
layout_mode = 2
theme_override_constants/margin_left = 15
theme_override_constants/margin_top = 15
theme_override_constants/margin_right = 15
theme_override_constants/margin_bottom = 15
[node name="DescriptionLabel" type="Label" parent="MissionManager/LearningPanel/MarginContainer/VBoxContainer/DescriptionPanel/MarginContainer"]
layout_mode = 2
size_flags_horizontal = 3
theme_override_font_sizes/font_size = 20
text = "Description goes here..."
autowrap_mode = 2
[node name="GraphTitle" type="Label" parent="MissionManager/LearningPanel/MarginContainer/VBoxContainer"]
layout_mode = 2
theme_override_font_sizes/font_size = 24
text = "Graph:"
horizontal_alignment = 1
[node name="GraphContainer" type="Panel" parent="MissionManager/LearningPanel/MarginContainer/VBoxContainer"]
custom_minimum_size = Vector2(0, 300)
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
size_flags_stretch_ratio = 2.0
theme_override_styles/panel = SubResource("StyleBoxFlat_graph")
[node name="AnswerContainer" type="VBoxContainer" parent="MissionManager/LearningPanel/MarginContainer/VBoxContainer"]
layout_mode = 2
theme_override_constants/separation = 10
[node name="QuestionLabel" type="Label" parent="MissionManager/LearningPanel/MarginContainer/VBoxContainer/AnswerContainer"]
layout_mode = 2
theme_override_font_sizes/font_size = 18
text = "How many workers do we need to build 10 houses in a week?"
horizontal_alignment = 1
[node name="AnswerField" type="LineEdit" parent="MissionManager/LearningPanel/MarginContainer/VBoxContainer/AnswerContainer"]
custom_minimum_size = Vector2(150, 40)
layout_mode = 2
size_flags_horizontal = 4
theme_override_font_sizes/font_size = 18
placeholder_text = "Enter answer"
alignment = 1
max_length = 5
[node name="CheckButton" type="Button" parent="MissionManager/LearningPanel/MarginContainer/VBoxContainer/AnswerContainer"]
custom_minimum_size = Vector2(150, 40)
layout_mode = 2
size_flags_horizontal = 4
theme_override_font_sizes/font_size = 16
text = "Check Answer"
[node name="FeedbackLabel" type="Label" parent="MissionManager/LearningPanel/MarginContainer/VBoxContainer/AnswerContainer"]
layout_mode = 2
size_flags_horizontal = 3
theme_override_font_sizes/font_size = 18
horizontal_alignment = 1
autowrap_mode = 2
text_overrun_behavior = 3
max_lines_visible = 6
[node name="HBoxContainer" type="HBoxContainer" parent="MissionManager/LearningPanel/MarginContainer/VBoxContainer"]
layout_mode = 2
alignment = 1
[node name="CompleteButton" type="Button" parent="MissionManager/LearningPanel/MarginContainer/VBoxContainer/HBoxContainer"]
custom_minimum_size = Vector2(200, 50)
layout_mode = 2
theme_override_font_sizes/font_size = 18
disabled = true
text = "Complete"
[node name="ObjectiveLabel" type="Label" parent="MissionManager"]
offset_right = 40.0
offset_bottom = 23.0
[connection signal="all_missions_completed" from="MissionManager" to="." method="_on_mission_manager_all_missions_completed"]
[connection signal="pressed" from="MissionManager/LearningPanel/MarginContainer/VBoxContainer/HBoxContainer/CompleteButton" to="MissionManager/LearningPanel" method="_on_complete_button_pressed"]

@ -0,0 +1,365 @@
[gd_scene load_steps=33 format=3 uid="uid://vgwrcfy1qawf"]
[ext_resource type="Script" uid="uid://snp3i7itqnqc" path="res://scripts/builder.gd" id="1_jybm7"]
[ext_resource type="Environment" uid="uid://jbptgqvstei3" path="res://scenes/main-environment.tres" id="1_yndf3"]
[ext_resource type="Script" uid="uid://cw0jlq5d8r66g" path="res://scripts/structure.gd" id="2_54v6r"]
[ext_resource type="Resource" uid="uid://dv14kkhb6umkv" path="res://structures/road-straight.tres" id="2_bwyku"]
[ext_resource type="Texture2D" uid="uid://cbk07cxgshg26" path="res://sprites/selector.png" id="4_wr1wv"]
[ext_resource type="Resource" uid="uid://cntgl86ianngh" path="res://structures/building-small-a.tres" id="5_v5o2m"]
[ext_resource type="Resource" uid="uid://ccb475jeg7ym5" path="res://structures/grass-trees.tres" id="6_fwsy4"]
[ext_resource type="Script" uid="uid://cu76h00erned0" path="res://scripts/view.gd" id="8_yovpv"]
[ext_resource type="Script" uid="uid://bnpqjt5n1s20m" path="res://scripts/mission/mission_manager.gd" id="10_oe3re"]
[ext_resource type="PackedScene" uid="uid://dmsy06s02tcw4" path="res://scenes/generic_text_panel.tscn" id="13_7i6dj"]
[ext_resource type="Script" uid="uid://bxuxhmlcqp64g" path="res://scripts/mission/mission_ui.gd" id="13_xvw5w"]
[ext_resource type="Script" uid="uid://d1rme8o0ewiet" path="res://resources/generic_text_panel.resource.gd" id="14_76jlq"]
[ext_resource type="Script" uid="uid://52tdmmosdbpa" path="res://scripts/mission/learning_panel.gd" id="14_q2ymb"]
[ext_resource type="Script" uid="uid://c6f12a8vs3hp6" path="res://scripts/mission/mission_data.gd" id="14_vcrh8"]
[ext_resource type="Resource" uid="uid://x5h4xutbldq3" path="res://mission/first_mission.tres" id="15_obmwc"]
[ext_resource type="Resource" uid="uid://cjr36hqnmyn0x" path="res://mission/second_mission.tres" id="16_rl54y"]
[ext_resource type="Resource" uid="uid://dykbopx8n3c3v" path="res://mission/third_mission.tres" id="17_rrdy6"]
[ext_resource type="FontFile" uid="uid://d0cxd77jybrcn" path="res://fonts/lilita_one_regular.ttf" id="17_vlub6"]
[ext_resource type="PackedScene" uid="uid://b4gkfwf4i3ydl" path="res://scenes/character.tscn" id="18_8lrh8"]
[ext_resource type="Resource" uid="uid://bho4qh41asyk1" path="res://mission/fourth_mission.tres" id="18_h4fpv"]
[ext_resource type="PackedScene" uid="uid://cgk66f6rg03mj" path="res://scenes/hud.tscn" id="18_hud"]
[ext_resource type="PackedScene" uid="uid://bqjnp7uypupog" path="res://scenes/controls_panel.tscn" id="19_controls"]
[ext_resource type="Resource" uid="uid://p3xwn2mp6bm6" path="res://mission/fifth_mission.tres" id="19_e8sub"]
[ext_resource type="Script" uid="uid://dlqco4kmwr3er" path="res://scripts/game_manager.gd" id="20_game_manager"]
[ext_resource type="Resource" uid="uid://bv4r7ebpjdce4" path="res://mission/sixth_mission.tres" id="20_r0ysx"]
[ext_resource type="PackedScene" uid="uid://b4s46k58ddpyc" path="res://scenes/sound_panel.tscn" id="21_sound_panel"]
[sub_resource type="Resource" id="Resource_1gdbm"]
script = ExtResource("14_76jlq")
panel_type = 0
title = "Welcome to Stem City "
body_text = "Hi League Community,
Your goal is to build a thriving community from the ground up. As you complete missions, you'll unlock new structures to expand and improve your city.
Each mission introduces important Math concepts used in urban planning and city management. You'll apply mathematics while watching your city grow.
You are the very first group of students who get to test this. So keep in mind there will be bugs, but do note them.
We are aware of the following bugs:
- Population count may be off by 1
- Lighting Baking in Web Builds are too bright
- We don't restrict building off of roads which will cause workers not to reach buildings
- Building overlap
- No builders for Power Plant
Ready to start planning your city? Click Close to see the controls and begin your first mission!
"
button_text = "Close"
[sub_resource type="Resource" id="Resource_ja86h"]
script = ExtResource("14_76jlq")
panel_type = 1
title = "Welcome to Stem City"
body_text = "Congratulations, City Planner!
You've completed all the guided missions and unlocked the full potential of Stem City. Your understanding of urban planning and STEM concepts has helped create a thriving community.
But the journey doesn't end here! Continue expanding your city using all the structures you've unlocked. Experiment with different layouts, create new neighborhoods, and see how large you can grow your population.
The future of Stem City is now in your hands - keep building and exploring!
"
button_text = "Close"
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_mission"]
bg_color = Color(0.145098, 0.172549, 0.231373, 0.941176)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(0.356863, 0.670588, 0.768627, 1)
corner_radius_top_left = 8
corner_radius_top_right = 8
corner_radius_bottom_right = 8
corner_radius_bottom_left = 8
shadow_size = 5
shadow_offset = Vector2(2, 2)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_lsmd5"]
bg_color = Color(0.196078, 0.196078, 0.196078, 0.960784)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(0.294118, 0.478431, 0.729412, 1)
corner_radius_top_left = 8
corner_radius_top_right = 8
corner_radius_bottom_right = 8
corner_radius_bottom_left = 8
shadow_size = 5
shadow_offset = Vector2(3, 3)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_description"]
bg_color = Color(0.145098, 0.145098, 0.164706, 0.768627)
border_width_left = 1
border_width_top = 1
border_width_right = 1
border_width_bottom = 1
border_color = Color(0.294118, 0.478431, 0.729412, 0.301961)
corner_radius_top_left = 4
corner_radius_top_right = 4
corner_radius_bottom_right = 4
corner_radius_bottom_left = 4
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_graph"]
bg_color = Color(0.117647, 0.137255, 0.160784, 0.768627)
border_width_left = 1
border_width_top = 1
border_width_right = 1
border_width_bottom = 1
border_color = Color(0.294118, 0.478431, 0.729412, 0.301961)
corner_radius_top_left = 4
corner_radius_top_right = 4
corner_radius_bottom_right = 4
corner_radius_bottom_left = 4
[node name="Main" type="Node3D"]
script = ExtResource("20_game_manager")
intro_text_resource = SubResource("Resource_1gdbm")
outro_text_resource = SubResource("Resource_ja86h")
[node name="Builder" type="Node3D" parent="." node_paths=PackedStringArray("selector", "selector_container", "view_camera", "gridmap", "cash_display")]
script = ExtResource("1_jybm7")
structures = Array[ExtResource("2_54v6r")]([ExtResource("2_bwyku"), ExtResource("5_v5o2m"), ExtResource("6_fwsy4")])
selector = NodePath("Selector")
selector_container = NodePath("Selector/Container")
view_camera = NodePath("../View/Camera")
gridmap = NodePath("../GridMap")
cash_display = NodePath("../CanvasLayer/HUD/HBoxContainer/CashItem/CashLabel")
[node name="Selector" type="Node3D" parent="Builder"]
[node name="Sprite" type="Sprite3D" parent="Builder/Selector"]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0.06, 0)
texture = ExtResource("4_wr1wv")
[node name="Container" type="Node3D" parent="Builder/Selector"]
[node name="View" type="Node3D" parent="."]
transform = Transform3D(0.707107, -0.40558, 0.579228, 0, 0.819152, 0.573576, -0.707107, -0.40558, 0.579228, 0, 0, 0)
script = ExtResource("8_yovpv")
[node name="Camera" type="Camera3D" parent="View"]
transform = Transform3D(1, 0, 0, 0, 1, 7.15256e-07, 0, 0, 1, 0, 27.98, 49.5918)
environment = ExtResource("1_yndf3")
fov = 20.0
[node name="GridMap" type="GridMap" parent="."]
cell_size = Vector3(1, 1, 1)
cell_center_x = false
cell_center_y = false
cell_center_z = false
[node name="Sun" type="DirectionalLight3D" parent="."]
transform = Transform3D(-0.422618, -0.694272, 0.582563, 0, 0.642788, 0.766044, -0.906308, 0.323744, -0.271654, 0, 0, 0)
shadow_enabled = true
shadow_opacity = 0.75
[node name="CanvasLayer" type="CanvasLayer" parent="."]
[node name="HUD" parent="CanvasLayer" instance=ExtResource("18_hud")]
[node name="ControlsPanel" parent="CanvasLayer" instance=ExtResource("19_controls")]
[node name="SoundPanel" parent="CanvasLayer" instance=ExtResource("21_sound_panel")]
anchors_preset = 8
[node name="GenericTextPanel" parent="CanvasLayer" instance=ExtResource("13_7i6dj")]
resource_data = ExtResource("14_76jlq")
[node name="MissionManager" type="Node" parent="." node_paths=PackedStringArray("mission_ui", "builder")]
script = ExtResource("10_oe3re")
missions = Array[ExtResource("14_vcrh8")]([ExtResource("15_obmwc"), ExtResource("16_rl54y"), ExtResource("17_rrdy6"), ExtResource("18_h4fpv"), ExtResource("19_e8sub"), ExtResource("20_r0ysx")])
mission_ui = NodePath("MissionPanel")
builder = NodePath("../Builder")
character_scene = ExtResource("18_8lrh8")
[node name="MissionPanel" type="PanelContainer" parent="MissionManager" node_paths=PackedStringArray("mission_title_label", "mission_description_label", "objectives_container")]
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -450.0
offset_top = 20.0
offset_right = -20.0
grow_horizontal = 0
size_flags_vertical = 0
theme_override_styles/panel = SubResource("StyleBoxFlat_mission")
script = ExtResource("13_xvw5w")
mission_title_label = NodePath("MarginContainer/VBoxContainer/MissionTitleLabel")
mission_description_label = NodePath("MarginContainer/VBoxContainer/MissionDescriptionLabel")
objectives_container = NodePath("MarginContainer/VBoxContainer/ObjectivesContainer")
[node name="MarginContainer" type="MarginContainer" parent="MissionManager/MissionPanel"]
layout_mode = 2
theme_override_constants/margin_left = 20
theme_override_constants/margin_top = 20
theme_override_constants/margin_right = 20
theme_override_constants/margin_bottom = 20
[node name="VBoxContainer" type="VBoxContainer" parent="MissionManager/MissionPanel/MarginContainer"]
layout_mode = 2
size_flags_vertical = 3
theme_override_constants/separation = 15
[node name="MissionTitleLabel" type="Label" parent="MissionManager/MissionPanel/MarginContainer/VBoxContainer"]
layout_mode = 2
theme_override_fonts/font = ExtResource("17_vlub6")
theme_override_font_sizes/font_size = 24
text = "Mission Title"
horizontal_alignment = 1
[node name="HSeparator" type="HSeparator" parent="MissionManager/MissionPanel/MarginContainer/VBoxContainer"]
layout_mode = 2
[node name="MissionDescriptionLabel" type="Label" parent="MissionManager/MissionPanel/MarginContainer/VBoxContainer"]
layout_mode = 2
size_flags_vertical = 1
theme_override_font_sizes/font_size = 16
text = "Mission description goes here..."
autowrap_mode = 2
text_overrun_behavior = 4
[node name="HSeparator2" type="HSeparator" parent="MissionManager/MissionPanel/MarginContainer/VBoxContainer"]
layout_mode = 2
[node name="ObjectivesLabel" type="Label" parent="MissionManager/MissionPanel/MarginContainer/VBoxContainer"]
layout_mode = 2
theme_override_colors/font_color = Color(0.678431, 0.847059, 1, 1)
theme_override_font_sizes/font_size = 18
text = "Objectives:"
[node name="ObjectivesContainer" type="VBoxContainer" parent="MissionManager/MissionPanel/MarginContainer/VBoxContainer"]
layout_mode = 2
size_flags_vertical = 3
theme_override_constants/separation = 10
[node name="LearningPanel" type="PanelContainer" parent="MissionManager"]
visible = false
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 50.0
offset_top = 50.0
offset_right = -50.0
offset_bottom = -50.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme_override_styles/panel = SubResource("StyleBoxFlat_lsmd5")
script = ExtResource("14_q2ymb")
[node name="MarginContainer" type="MarginContainer" parent="MissionManager/LearningPanel"]
layout_mode = 2
theme_override_constants/margin_left = 30
theme_override_constants/margin_top = 30
theme_override_constants/margin_right = 30
theme_override_constants/margin_bottom = 30
[node name="VBoxContainer" type="VBoxContainer" parent="MissionManager/LearningPanel/MarginContainer"]
layout_mode = 2
size_flags_vertical = 3
theme_override_constants/separation = 20
[node name="TitleLabel" type="Label" parent="MissionManager/LearningPanel/MarginContainer/VBoxContainer"]
layout_mode = 2
theme_override_fonts/font = ExtResource("17_vlub6")
theme_override_font_sizes/font_size = 32
text = "Learning Module"
horizontal_alignment = 1
[node name="HSeparator" type="HSeparator" parent="MissionManager/LearningPanel/MarginContainer/VBoxContainer"]
layout_mode = 2
[node name="DescriptionPanel" type="PanelContainer" parent="MissionManager/LearningPanel/MarginContainer/VBoxContainer"]
layout_mode = 2
size_flags_vertical = 3
size_flags_stretch_ratio = 0.5
theme_override_styles/panel = SubResource("StyleBoxFlat_description")
[node name="MarginContainer" type="MarginContainer" parent="MissionManager/LearningPanel/MarginContainer/VBoxContainer/DescriptionPanel"]
layout_mode = 2
theme_override_constants/margin_left = 15
theme_override_constants/margin_top = 15
theme_override_constants/margin_right = 15
theme_override_constants/margin_bottom = 15
[node name="DescriptionLabel" type="Label" parent="MissionManager/LearningPanel/MarginContainer/VBoxContainer/DescriptionPanel/MarginContainer"]
layout_mode = 2
size_flags_horizontal = 3
theme_override_font_sizes/font_size = 20
text = "Description goes here..."
autowrap_mode = 2
[node name="GraphTitle" type="Label" parent="MissionManager/LearningPanel/MarginContainer/VBoxContainer"]
layout_mode = 2
theme_override_font_sizes/font_size = 24
text = "Graph:"
horizontal_alignment = 1
[node name="GraphContainer" type="Panel" parent="MissionManager/LearningPanel/MarginContainer/VBoxContainer"]
custom_minimum_size = Vector2(0, 300)
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
size_flags_stretch_ratio = 2.0
theme_override_styles/panel = SubResource("StyleBoxFlat_graph")
[node name="AnswerContainer" type="VBoxContainer" parent="MissionManager/LearningPanel/MarginContainer/VBoxContainer"]
layout_mode = 2
theme_override_constants/separation = 10
[node name="QuestionLabel" type="Label" parent="MissionManager/LearningPanel/MarginContainer/VBoxContainer/AnswerContainer"]
layout_mode = 2
theme_override_font_sizes/font_size = 18
text = "How many workers do we need to build 10 houses in a week?"
horizontal_alignment = 1
[node name="AnswerField" type="LineEdit" parent="MissionManager/LearningPanel/MarginContainer/VBoxContainer/AnswerContainer"]
custom_minimum_size = Vector2(150, 40)
layout_mode = 2
size_flags_horizontal = 4
theme_override_font_sizes/font_size = 18
placeholder_text = "Enter answer"
alignment = 1
max_length = 5
[node name="CheckButton" type="Button" parent="MissionManager/LearningPanel/MarginContainer/VBoxContainer/AnswerContainer"]
custom_minimum_size = Vector2(150, 40)
layout_mode = 2
size_flags_horizontal = 4
theme_override_font_sizes/font_size = 16
text = "Check Answer"
[node name="FeedbackLabel" type="Label" parent="MissionManager/LearningPanel/MarginContainer/VBoxContainer/AnswerContainer"]
layout_mode = 2
size_flags_horizontal = 3
theme_override_font_sizes/font_size = 18
horizontal_alignment = 1
autowrap_mode = 2
text_overrun_behavior = 3
max_lines_visible = 6
[node name="HBoxContainer" type="HBoxContainer" parent="MissionManager/LearningPanel/MarginContainer/VBoxContainer"]
layout_mode = 2
alignment = 1
[node name="CompleteButton" type="Button" parent="MissionManager/LearningPanel/MarginContainer/VBoxContainer/HBoxContainer"]
custom_minimum_size = Vector2(200, 50)
layout_mode = 2
theme_override_font_sizes/font_size = 18
disabled = true
text = "Complete"
[node name="ObjectiveLabel" type="Label" parent="MissionManager"]
offset_right = 40.0
offset_bottom = 23.0
[connection signal="all_missions_completed" from="MissionManager" to="." method="_on_mission_manager_all_missions_completed"]
[connection signal="pressed" from="MissionManager/LearningPanel/MarginContainer/VBoxContainer/HBoxContainer/CompleteButton" to="MissionManager/LearningPanel" method="_on_complete_button_pressed"]

@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://cam5blhxixlnb"]
[ext_resource type="Script" path="res://scripts/mission/mission_ui.gd" id="1_wl28p"]
[ext_resource type="Script" uid="uid://bxuxhmlcqp64g" path="res://scripts/mission/mission_ui.gd" id="1_wl28p"]
[node name="Control" type="Control"]
layout_mode = 3

@ -1,13 +1,15 @@
[gd_scene load_steps=7 format=3 uid="uid://c6qxpgne58hon"]
[ext_resource type="PackedScene" uid="uid://b4tgtg0j2dgh8" path="res://models/road-straight.glb" id="1_e1p8p"]
[ext_resource type="Script" uid="uid://dm10exi6726ue" path="res://scripts/pathfinding.gd" id="2_3elxe"]
[ext_resource type="Script" uid="uid://boe3mr1ujtk2s" path="res://scripts/pathfinding.gd" id="2_3elxe"]
[ext_resource type="PackedScene" uid="uid://h2jjkvc4edsp" path="res://people/character-female-d.glb" id="3_8fawu"]
[sub_resource type="NavigationMesh" id="NavigationMesh_h3aaa"]
[sub_resource type="ArrayMesh" id="ArrayMesh_3nstm"]
[sub_resource type="Resource" id="Resource_a0y0n"]
metadata/__load_path__ = "res://models/road-straight.glb"
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_sokgf"]
radius = 0.343066
height = 1.11949
@ -21,7 +23,7 @@ navigation_mesh = SubResource("NavigationMesh_h3aaa")
mesh = SubResource("ArrayMesh_3nstm")
skeleton = NodePath("../..")
[node name="road-straight" parent="NavigationRegion3D/MeshInstance3D" instance=ExtResource("1_e1p8p")]
[node name="road-straight" parent="NavigationRegion3D/MeshInstance3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.280188, 0.345876, 0.507542)
[node name="CharacterBody3D" type="CharacterBody3D" parent="NavigationRegion3D"]

@ -1,12 +1,13 @@
[gd_scene load_steps=3 format=3 uid="uid://b3kdhu8jq41iq"]
[ext_resource type="PackedScene" uid="uid://b4tgtg0j2dgh8" path="res://models/road-straight.glb" id="2_kgyfd"]
[sub_resource type="NavigationMesh" id="NavigationMesh_qdlwc"]
vertices = PackedVector3Array(-1.27868, 0.435088, -1.17848, -1.27868, 0.435088, 1.32152, 1.22132, 0.435088, 1.32152, 1.22132, 0.435088, -1.17848)
polygons = [PackedInt32Array(3, 2, 0), PackedInt32Array(0, 2, 1)]
agent_radius = 0.25
[sub_resource type="Resource" id="Resource_dvt8f"]
metadata/__load_path__ = "res://models/road-straight.glb"
[node name="NavigationRegion3D" type="NavigationRegion3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.0819869, 0)
navigation_mesh = SubResource("NavigationMesh_qdlwc")
@ -14,7 +15,7 @@ navigation_mesh = SubResource("NavigationMesh_qdlwc")
[node name="Camera3D" type="Camera3D" parent="."]
transform = Transform3D(0.030951, -0.708895, 0.704634, -0.0307357, 0.703964, 0.709571, -0.999048, -0.0436194, -3.08005e-08, 2.29147, 2.02866, 0)
[node name="road-straight" parent="." instance=ExtResource("2_kgyfd")]
[node name="road-straight" parent="."]
transform = Transform3D(3, 0, 0, 0, 3, 0, 0, 0, 3, -0.0286824, -0.0649124, 0.0715187)
[editable path="road-straight"]

@ -1,6 +1,6 @@
[gd_scene load_steps=7 format=3 uid="uid://b4s46k58ddpyc"]
[ext_resource type="Script" uid="uid://danypf5uo4vob" path="res://scripts/sound_panel.gd" id="1_c6ykp"]
[ext_resource type="Script" uid="uid://wxdjmv1kdo1r" path="res://scripts/sound_panel.gd" id="1_c6ykp"]
[ext_resource type="FontFile" uid="uid://d0cxd77jybrcn" path="res://fonts/lilita_one_regular.ttf" id="2_kpgjp"]
[ext_resource type="Texture2D" uid="uid://hx3maksi7ma" path="res://sprites/unmuted.png" id="3_c3hj5"]
[ext_resource type="Texture2D" uid="uid://djxd33vvtr58p" path="res://sprites/muted.png" id="4_jdlh2"]

@ -1,6 +1,6 @@
[gd_scene load_steps=4 format=3 uid="uid://cc3c30ioo11if"]
[ext_resource type="Script" path="res://scripts/mission/unlocked_items_panel.gd" id="1_j0tih"]
[ext_resource type="Script" uid="uid://uftqbpj0c2u8" path="res://scripts/mission/unlocked_items_panel.gd" id="1_j0tih"]
[ext_resource type="FontFile" uid="uid://d0cxd77jybrcn" path="res://fonts/lilita_one_regular.ttf" id="2_exmr5"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_2q5cr"]

@ -0,0 +1 @@
uid://buvxhq2ipa8gt

@ -0,0 +1 @@
uid://b1014mouu2vqu

@ -0,0 +1 @@
uid://csqc100kx2nsm

@ -55,22 +55,24 @@ func _ready():
# Sound effects now handled in game_manager.gd
for structure in structures:
if structure.model == null:
continue
var id = mesh_library.get_last_unused_item_id()
mesh_library.create_item(id)
mesh_library.set_item_mesh(id, get_mesh(structure.model))
# Apply appropriate scaling for buildings and roads
var transform = Transform3D()
if structure.model.resource_path.contains("power_plant"):
var _xform = Transform3D()
if structure.model.resource_path != null and structure.model.resource_path.contains("power_plant"):
# Scale power plant model to be much smaller (0.5x)
transform = transform.scaled(Vector3(0.5, 0.5, 0.5))
_xform = _xform.scaled(Vector3(0.5, 0.5, 0.5))
elif structure.type == Structure.StructureType.RESIDENTIAL_BUILDING or structure.type == Structure.StructureType.ROAD:
# Scale buildings and roads to be consistent (3x)
transform = transform.scaled(Vector3(3.0, 3.0, 3.0))
_xform = _xform.scaled(Vector3(3.0, 3.0, 3.0))
mesh_library.set_item_mesh_transform(id, transform)
mesh_library.set_item_mesh_transform(id, _xform)
gridmap.mesh_library = mesh_library
@ -80,7 +82,10 @@ func _ready():
if "unlocked" in structures[i] and structures[i].unlocked:
index = i
found_unlocked = true
print("Starting with unlocked structure: " + structures[i].model.resource_path)
if structures[i].model != null:
print("Starting with unlocked structure: " + structures[i].model.resource_path)
else:
print("Starting with unlocked structure: (no model)")
break
if not found_unlocked:
@ -133,7 +138,7 @@ func is_mouse_over_ui() -> bool:
# Get HUD dimensions for debug
var hud = get_node_or_null("/root/Main/CanvasLayer/HUD")
if hud:
var hud_rect = hud.get_global_rect()
var _hud_rect = hud.get_global_rect()
# Get HBoxContainer dimensions - this is the actual content area
var hbox = hud.get_node_or_null("HBoxContainer")
@ -173,6 +178,9 @@ func is_mouse_over_ui() -> bool:
func get_mesh(packed_scene):
# Instantiate the scene to access its properties
if packed_scene == null:
return
var scene_instance = packed_scene.instantiate()
var mesh_instance = null
@ -227,13 +235,13 @@ func action_build(gridmap_position):
# For residential buildings, we use the construction manager in mission 3
var is_residential = structures[index].type == Structure.StructureType.RESIDENTIAL_BUILDING
# For power plants, we handle them specially
var is_power_plant = structures[index].model.resource_path.contains("power_plant")
var is_power_plant = structures[index].model != null and structures[index].model.resource_path.contains("power_plant")
# For grass and trees (terrain), we need special handling
var is_terrain = structures[index].type == Structure.StructureType.TERRAIN
# Check if we're in mission 3 (when we should use construction workers)
# Function to check if we're in mission 3 (when we should use construction workers)
var use_worker_construction = true
var mission_manager = get_node_or_null("/root/Main/MissionManager")
var _mission_manager = get_node_or_null("/root/Main/MissionManager")
# Sound effects are handled via game_manager.gd through the structure_placed signal
if is_road:
@ -355,7 +363,7 @@ func action_demolish(gridmap_position):
# Check for building model in the scene as a direct child of builder
var building_model_name = "Building_" + str(int(gridmap_position.x)) + "_" + str(int(gridmap_position.z))
var has_building_model = has_node(building_model_name)
var _has_building_model = has_node(building_model_name)
# Store structure index before removal for signaling
var structure_index = -1
@ -423,7 +431,7 @@ func action_demolish(gridmap_position):
# This function is no longer needed since we're using a single NavRegion3D
# Keeping it for compatibility, but it doesn't do anything now
func remove_navigation_region(position: Vector3):
func remove_navigation_region(_pos: Vector3):
# With our new approach using a single nav region, we just rebake
# the entire navigation mesh when roads are added or removed
@ -480,15 +488,31 @@ func update_structure():
for n in selector_container.get_children():
selector_container.remove_child(n)
# Check if we have a valid structure and model
if index < 0 or index >= structures.size():
print("Invalid structure index: ", index)
return
if not structures[index].model:
# print("No model found for structure at index: ", index)
return
# Create new structure preview in selector
var _model = structures[index].model.instantiate()
if not _model:
print("Failed to instantiate model for structure at index: ", index)
return
selector_container.add_child(_model)
# Get reference to the selector sprite
var selector_sprite = selector.get_node("Sprite")
if not selector_sprite:
print("No Sprite node found in selector")
return
# Apply appropriate scaling based on structure type
if structures[index].model.resource_path.contains("power_plant"):
if structures[index].model.resource_path != null and structures[index].model.resource_path.contains("power_plant"):
# Scale power plant model to be much smaller (0.5x)
_model.scale = Vector3(0.5, 0.5, 0.5)
# Center the power plant model within the selector
@ -496,7 +520,7 @@ func update_structure():
elif (structures[index].type == Structure.StructureType.RESIDENTIAL_BUILDING
or structures[index].type == Structure.StructureType.ROAD
or structures[index].type == Structure.StructureType.TERRAIN
or structures[index].model.resource_path.contains("grass")):
or (structures[index].model.resource_path != null and structures[index].model.resource_path.contains("grass"))):
# Scale buildings, roads, and decorative terrain to match (3x)
_model.scale = Vector3(3.0, 3.0, 3.0)
_model.position.y += 0.0 # No need for Y adjustment with scaling
@ -514,13 +538,13 @@ func update_cash():
cash_display.text = "$" + str(map.cash)
# Function to add a road model as a child of the navigation region
func _add_road_to_navregion(position: Vector3, structure_index: int):
func _add_road_to_navregion(_pos: Vector3, structure_index: int):
# Make sure we have a navigation region
if not nav_region:
setup_navigation_region()
# Create a unique name for this road based on its position
var road_name = "Road_" + str(int(position.x)) + "_" + str(int(position.z))
var road_name = "Road_" + str(int(_pos.x)) + "_" + str(int(_pos.z))
# Check if a road with this name already exists
if nav_region.has_node(road_name):
@ -528,7 +552,7 @@ func _add_road_to_navregion(position: Vector3, structure_index: int):
# Instantiate the road model - get the actual model based on road type
var road_model
var model_path = structures[structure_index].model.resource_path
var model_path = structures[structure_index].model.resource_path if structures[structure_index].model != null else ""
if model_path.contains("road-straight"):
# Use the specific road-straight model that works with navmesh
road_model = load("res://models/road-straight.glb").instantiate()
@ -545,27 +569,27 @@ func _add_road_to_navregion(position: Vector3, structure_index: int):
nav_region.add_child(road_model)
# Create the transform directly matching the exact one from pathing.tscn
var transform = Transform3D()
var _transform = Transform3D()
# Set scale first
transform.basis = Basis().scaled(Vector3(3.0, 3.0, 3.0))
_transform.basis = Basis().scaled(Vector3(3.0, 3.0, 3.0))
# Then apply rotation from the selector to preserve the rotation the player chose
transform.basis = transform.basis * selector.basis
_transform.basis = _transform.basis * selector.basis
# Set position
transform.origin = position
transform.origin.y = -0.065 # From the pathing scene y offset
_transform.origin = _pos
_transform.origin.y = -0.065 # From the pathing scene y offset
# Apply the complete transform in one go
road_model.transform = transform
road_model.transform = _transform
# Function to add a power plant as a direct child of the builder
func _add_power_plant(position: Vector3, structure_index: int):
func _add_power_plant(_pos: Vector3, structure_index: int):
# Create a unique name for this power plant based on its position
var power_plant_name = "PowerPlant_" + str(int(position.x)) + "_" + str(int(position.z))
var power_plant_name = "PowerPlant_" + str(int(_pos.x)) + "_" + str(int(_pos.z))
# Check if a power plant with this name already exists
if has_node(power_plant_name):
@ -579,30 +603,30 @@ func _add_power_plant(position: Vector3, structure_index: int):
add_child(power_plant_model)
# Create the transform
var transform = Transform3D()
var _transform = Transform3D()
# Set scale (using the smaller 0.5x scale)
transform.basis = Basis().scaled(Vector3(0.5, 0.5, 0.5))
_transform.basis = Basis().scaled(Vector3(0.5, 0.5, 0.5))
# Apply rotation from the selector to preserve the rotation the player chose
transform.basis = transform.basis * selector.basis
_transform.basis = _transform.basis * selector.basis
# Set position with offset to center the model at the grid position
transform.origin = position
_transform.origin = _pos
# Apply position offset to center the model (matching the preview)
# These offsets need to be transformed based on the current rotation
var offset = selector.basis * Vector3(0.25, 0, -0.25)
transform.origin += offset
_transform.origin += offset
# Apply the complete transform in one go
power_plant_model.transform = transform
power_plant_model.transform = _transform
# Function to remove a power plant
func _remove_power_plant(position: Vector3):
func _remove_power_plant(_pos: Vector3):
# Get the power plant name based on its position
var power_plant_name = "PowerPlant_" + str(int(position.x)) + "_" + str(int(position.z))
var power_plant_name = "PowerPlant_" + str(int(_pos.x)) + "_" + str(int(_pos.z))
# Check if a power plant with this name exists
if has_node(power_plant_name):
@ -615,21 +639,21 @@ func _remove_power_plant(position: Vector3):
pass
# Function to remove a resident model when a residential building is demolished
func _remove_resident_for_building(position: Vector3):
func _remove_resident_for_building(_pos: Vector3):
# First, check if we have a nav region reference
if not nav_region and has_node("NavRegion3D"):
nav_region = get_node("NavRegion3D")
if nav_region:
# Look for resident with matching position in the name
var resident_name = "Resident_" + str(int(position.x)) + "_" + str(int(position.z))
var resident_name = "Resident_" + str(int(_pos.x)) + "_" + str(int(_pos.z))
# First try to find by exact name
var found = false
var _found = false
for child in nav_region.get_children():
if child.name.begins_with(resident_name):
child.queue_free()
found = true
_found = true
# Update the HUD population count
var hud = get_node_or_null("/root/Main/CanvasLayer/HUD")
@ -653,9 +677,9 @@ func _update_mission_objective_on_demolish():
mission_manager.update_objective_progress(mission_id, MissionObjective.ObjectiveType.BUILD_RESIDENTIAL, -1)
# Function to remove terrain (grass or trees)
func _remove_terrain(position: Vector3):
func _remove_terrain(_pos: Vector3):
# Get the terrain name based on its position
var terrain_name = "Terrain_" + str(int(position.x)) + "_" + str(int(position.z))
var terrain_name = "Terrain_" + str(int(_pos.x)) + "_" + str(int(_pos.z))
# Check if terrain with this name exists
if has_node(terrain_name):
@ -667,15 +691,15 @@ func _remove_terrain(position: Vector3):
pass
# Function to remove building model from scene
func _remove_building_model(position: Vector3):
func _remove_building_model(_pos: Vector3):
# Try multiple possible naming patterns
var building_patterns = [
"Building_" + str(int(position.x)) + "_" + str(int(position.z)),
"building-small-a_" + str(int(position.x)) + "_" + str(int(position.z)),
"building-small-b_" + str(int(position.x)) + "_" + str(int(position.z)),
"building-small-c_" + str(int(position.x)) + "_" + str(int(position.z)),
"building-small-d_" + str(int(position.x)) + "_" + str(int(position.z)),
"building-garage_" + str(int(position.x)) + "_" + str(int(position.z))
"Building_" + str(int(_pos.x)) + "_" + str(int(_pos.z)),
"building-small-a_" + str(int(_pos.x)) + "_" + str(int(_pos.z)),
"building-small-b_" + str(int(_pos.x)) + "_" + str(int(_pos.z)),
"building-small-c_" + str(int(_pos.x)) + "_" + str(int(_pos.z)),
"building-small-d_" + str(int(_pos.x)) + "_" + str(int(_pos.z)),
"building-garage_" + str(int(_pos.x)) + "_" + str(int(_pos.z))
]
# Check if we can find the building model with any of the pattern names
@ -696,7 +720,7 @@ func _remove_building_model(position: Vector3):
continue
# Check if this building is at our position (with some tolerance)
var pos_diff = (child.global_transform.origin - position).abs()
var pos_diff = (child.global_transform.origin - _pos).abs()
if pos_diff.x < 0.5 and pos_diff.z < 0.5:
child.queue_free()
found = true
@ -712,7 +736,7 @@ func _remove_building_model(position: Vector3):
continue
# Check if this building is at our position (with some tolerance)
var pos_diff = (child.global_transform.origin - position).abs()
var pos_diff = (child.global_transform.origin - _pos).abs()
if pos_diff.x < 0.5 and pos_diff.z < 0.5:
child.queue_free()
found = true
@ -722,20 +746,20 @@ func _remove_building_model(position: Vector3):
if !found and gridmap:
for child in gridmap.get_children():
# Check if this is any model at our position (with some tolerance)
var pos_diff = (child.global_transform.origin - position).abs()
var pos_diff = (child.global_transform.origin - _pos).abs()
if pos_diff.x < 0.5 and pos_diff.z < 0.5:
child.queue_free()
found = true
break
# Function to remove a road model from the navigation region
func _remove_road_from_navregion(position: Vector3):
func _remove_road_from_navregion(_pos: Vector3):
# Make sure we have a navigation region
if not nav_region:
return
# Get the road name based on its position
var road_name = "Road_" + str(int(position.x)) + "_" + str(int(position.z))
var road_name = "Road_" + str(int(_pos.x)) + "_" + str(int(_pos.z))
# Check if a road with this name exists
if nav_region.has_node(road_name):
@ -758,7 +782,7 @@ func _add_existing_roads_to_navregion():
child.queue_free()
# Find all road cells in the gridmap
var added_count = 0
var _added_count = 0
# We need to convert any existing roads in the GridMap to our new system
# Find existing road cells and add them to the NavRegion3D, then clear from GridMap
@ -770,7 +794,7 @@ func _add_existing_roads_to_navregion():
_add_road_to_navregion(cell, structure_index)
# Remove from the GridMap since we're now handling roads differently
gridmap.set_cell_item(cell, -1)
added_count += 1
_added_count += 1
# Function to move all character NPCs to be children of the navigation region
func _move_characters_to_navregion():
@ -799,9 +823,9 @@ func _move_characters_to_navregion():
# Function to add terrain (grass or trees) as a direct child
func _add_terrain(position: Vector3, structure_index: int):
func _add_terrain(_pos: Vector3, structure_index: int):
# Create a unique name for this terrain element based on its position
var terrain_name = "Terrain_" + str(int(position.x)) + "_" + str(int(position.z))
var terrain_name = "Terrain_" + str(int(_pos.x)) + "_" + str(int(_pos.z))
# Check if terrain with this name already exists
if has_node(terrain_name):
@ -815,22 +839,22 @@ func _add_terrain(position: Vector3, structure_index: int):
add_child(terrain_model)
# Create the transform
var transform = Transform3D()
var _transform = Transform3D()
# Set scale (using 3.0 scale as per other terrain elements)
transform.basis = Basis().scaled(Vector3(3.0, 3.0, 3.0))
_transform.basis = Basis().scaled(Vector3(3.0, 3.0, 3.0))
# Apply rotation from the selector to preserve the rotation the player chose
transform.basis = transform.basis * selector.basis
_transform.basis = _transform.basis * selector.basis
# Set position
transform.origin = position
_transform.origin = _pos
# Apply the complete transform in one go
terrain_model.transform = transform
terrain_model.transform = _transform
# Callback for when construction is completed
func _on_construction_completed(position: Vector3):
func _on_construction_completed(_pos: Vector3):
# We need to find a residential structure index to add to gridmap
var residential_index = -1
for i in range(structures.size()):
@ -843,14 +867,14 @@ func _on_construction_completed(position: Vector3):
var rotation_index = 0
# Try to get the rotation index from the construction manager
if construction_manager and construction_manager.construction_sites.has(position):
var site = construction_manager.construction_sites[position]
if construction_manager and construction_manager.construction_sites.has(_pos):
var site = construction_manager.construction_sites[_pos]
if site.has("rotation_index"):
rotation_index = site["rotation_index"]
# Add the completed residential building to the gridmap with the correct rotation
gridmap.set_cell_item(position, residential_index, rotation_index)
gridmap.set_cell_item(_pos, residential_index, rotation_index)
# Check if we need to spawn a character for mission 1
var mission_manager = get_node_or_null("/root/Main/MissionManager")
@ -862,7 +886,7 @@ func _on_construction_completed(position: Vector3):
# Now check if we need to manually handle mission 1 character spawning
if mission_manager.current_mission and mission_manager.current_mission.id == "1" and not mission_manager.character_spawned:
mission_manager.character_spawned = true
mission_manager._spawn_character_on_road(position)
mission_manager._spawn_character_on_road(_pos)
# NOTE: We removed the structure_placed signal emission here to fix the population double-counting
else:

@ -0,0 +1 @@
uid://snp3i7itqnqc

@ -0,0 +1 @@
uid://b2vlnidm83s8y

@ -0,0 +1 @@
uid://pwnd0fyfkjed

@ -0,0 +1 @@
uid://3r6pls585y3h

@ -0,0 +1 @@
uid://b50gqdyny3llp

@ -42,7 +42,7 @@ func _ready():
controls_panel.closed.connect(_on_controls_panel_closed)
# Check for audio initialization status (important for web)
var sound_manager = get_node_or_null("/root/SoundManager")
var _sound_manager = get_node_or_null("/root/SoundManager")
var can_initialize_audio = true
#
# if OS.has_feature("web") and sound_manager:
@ -232,7 +232,7 @@ func setup_construction_sfx():
construction_sfx.bus = "SFX" # Use the SFX bus
# Play the building sound effect when a structure is placed
func _on_structure_placed(structure_index, position):
func _on_structure_placed(_structure_index, _position):
# Check web audio initialized status if needed
var can_play_audio = true
if OS.has_feature("web"):

@ -0,0 +1 @@
uid://dlqco4kmwr3er

@ -0,0 +1 @@
uid://caabw5op0u6tc

@ -0,0 +1 @@
uid://b40gjqb6qr1w7

@ -0,0 +1 @@
uid://bxuxhmlcqp64g

@ -0,0 +1 @@
uid://urmot4hfnvtb

@ -0,0 +1 @@
uid://boe3mr1ujtk2s

@ -189,10 +189,10 @@ func _on_react_audio_ready():
audio_ready.emit()
# Called when AudioBridge connects to the platform-one sound manager
func _on_audio_bridge_connected(is_connected: bool):
print("AudioBridge connected: ", is_connected)
func _on_audio_bridge_connected(connected: bool):
print("AudioBridge connected: ", connected)
if is_connected:
if connected:
audio_initialized = true
# Request the sound state from the platform-one sound manager
@ -221,24 +221,42 @@ func init_web_audio_from_js():
#if OS.has_feature("web") and not audio_initialized:
#_initialize_web_audio()
# Initialize audio for web builds
# Initialize web audio system
func _initialize_web_audio():
# Only initialize if we haven't already
if audio_initialized:
return
# For web builds, we notify JavaScript to initialize audio
# if OS.has_feature("web"):
# JSBridge.JavaScriptGlobal.handle_audio_action("INITIALIZE_AUDIO")
#
# # We don't need to create any dummy players, as JavaScript will handle the audio
# audio_initialized = true
# audio_ready.emit()
# return
# For non-web platforms, initialize Godot audio (this shouldn't get called)
# if not OS.has_feature("web"):
# Set the flag to prevent multiple initializations
# Try to initialize the audio context
if Engine.has_singleton("JavaScriptBridge"):
var js = Engine.get_singleton("JavaScriptBridge")
js.eval("""
(function() {
try {
// Create or get the audio context
if (!window._godotAudioContext) {
window._godotAudioContext = new (window.AudioContext || window.webkitAudioContext)();
console.log('SoundManager: Created new audio context');
}
// Resume the audio context if it's suspended
if (window._godotAudioContext.state === 'suspended') {
window._godotAudioContext.resume();
console.log('SoundManager: Resumed audio context');
}
// Set initialized flag
window._godotAudioInitialized = true;
} catch(e) {
console.error('SoundManager: Error initializing audio:', e);
}
})()
""")
# Set our initialized flag
audio_initialized = true
# Emit the ready signal
audio_ready.emit()
# Play background music
@ -252,7 +270,7 @@ func play_music(sound_name: String, loop: bool = true):
# For web builds, try multiple bridge options
# if OS.has_feature("web"):
# # Try AudioBridge first (platform-one integration)
# if audio_bridge != null and audio_bridge.get("is_connected") == true:
# if audio_bridge != null and audio_bridge.get("connected") == true:
# print("Using AudioBridge to play music: ", sound_name)
# if audio_bridge.has_method("play_music") and audio_bridge.play_music(sound_name):
# return
@ -300,7 +318,7 @@ func play_sfx(sound_name: String):
# For web builds, try multiple bridge options
#if OS.has_feature("web"):
## Try AudioBridge first (platform-one integration)
#if audio_bridge != null and audio_bridge.get("is_connected") == true:
#if audio_bridge != null and audio_bridge.get("connected") == true:
#print("Using AudioBridge to play sfx: ", sound_name)
#if audio_bridge.has_method("play_sfx") and audio_bridge.play_sfx(sound_name):
#return
@ -350,7 +368,7 @@ func stop_music():
# For web builds, try multiple bridge options
#if OS.has_feature("web"):
## Try AudioBridge first (platform-one integration)
#if audio_bridge != null and audio_bridge.get("is_connected") == true:
#if audio_bridge != null and audio_bridge.get("connected") == true:
#print("Using AudioBridge to stop music")
#if audio_bridge.has_method("stop_music") and audio_bridge.stop_music():
#current_music = ""
@ -377,7 +395,7 @@ func set_music_volume(volume: float):
pass
# if OS.has_feature("web"):
# # Try AudioBridge first (platform-one integration)
# if audio_bridge != null and audio_bridge.get("is_connected") == true:
# if audio_bridge != null and audio_bridge.get("connected") == true:
# print("Using AudioBridge to set music volume: ", music_volume)
# if audio_bridge.has_method("set_music_volume"):
# audio_bridge.set_music_volume(music_volume)
@ -401,7 +419,7 @@ func set_sfx_volume(volume: float):
if false:
pass
# # Try AudioBridge first (platform-one integration)
# if audio_bridge != null and audio_bridge.get("is_connected") == true:
# if audio_bridge != null and audio_bridge.get("connected") == true:
# print("Using AudioBridge to set sfx volume: ", sfx_volume)
# if audio_bridge.has_method("set_sfx_volume"):
# audio_bridge.set_sfx_volume(sfx_volume)
@ -425,7 +443,7 @@ func toggle_music_mute():
if false:
pass
# # Try AudioBridge first (platform-one integration)
# if audio_bridge != null and audio_bridge.get("is_connected") == true:
# if audio_bridge != null and audio_bridge.get("connected") == true:
# print("Using AudioBridge to toggle music mute: ", music_muted)
# if audio_bridge.has_method("toggle_music_mute"):
# audio_bridge.toggle_music_mute()
@ -449,7 +467,7 @@ func toggle_sfx_mute():
if false:
pass
# # Try AudioBridge first (platform-one integration)
# if audio_bridge != null and audio_bridge.get("is_connected") == true:
# if audio_bridge != null and audio_bridge.get("connected") == true:
# print("Using AudioBridge to toggle sfx mute: ", sfx_muted)
# if audio_bridge.has_method("toggle_sfx_mute"):
# audio_bridge.toggle_sfx_mute()

@ -0,0 +1 @@
uid://dwbcncga3rbmv

@ -106,4 +106,4 @@ func _update_music_label(value):
func _update_sfx_label(value):
var percentage = int(value * 100)
sfx_value_label.text = str(percentage) + "%"
sfx_value_label.text = str(percentage) + "%"

@ -0,0 +1 @@
uid://wxdjmv1kdo1r

@ -0,0 +1 @@
uid://cw0jlq5d8r66g

@ -0,0 +1 @@
uid://cu76h00erned0

@ -1,10 +1,11 @@
[gd_resource type="Resource" script_class="Structure" load_steps=3 format=3 uid="uid://bqb6g3t0tebno"]
[ext_resource type="PackedScene" uid="uid://d0nnrx2y4px2v" path="res://models/building-garage.glb" id="1_gyclk"]
[ext_resource type="Script" path="res://scripts/structure.gd" id="2_jrinw"]
[ext_resource type="Script" uid="uid://cw0jlq5d8r66g" path="res://scripts/structure.gd" id="2_jrinw"]
[resource]
script = ExtResource("2_jrinw")
title = ""
model = ExtResource("1_gyclk")
type = 1
price = 70
@ -12,3 +13,6 @@ population_count = 0
kW_usage = 0.0
kW_production = 0.0
selector_scale = 2.8
unlocked = false
description = "Description"
thumbnail = "Thumbnail"

@ -1,7 +1,7 @@
[gd_resource type="Resource" script_class="Structure" load_steps=3 format=3 uid="uid://cntgl86ianngh"]
[ext_resource type="PackedScene" uid="uid://cnycdi6t5tj01" path="res://models/building-small-a.glb" id="1_v5apy"]
[ext_resource type="Script" path="res://scripts/structure.gd" id="2_q3i1h"]
[ext_resource type="Script" uid="uid://cw0jlq5d8r66g" path="res://scripts/structure.gd" id="2_q3i1h"]
[resource]
script = ExtResource("2_q3i1h")

@ -1,10 +1,11 @@
[gd_resource type="Resource" script_class="Structure" load_steps=3 format=3 uid="uid://c5fveedgvunju"]
[ext_resource type="PackedScene" uid="uid://d2h51qlls136h" path="res://models/building-small-b.glb" id="1_klt7o"]
[ext_resource type="Script" uid="uid://smbpvh2nwds4" path="res://scripts/structure.gd" id="2_a2t3e"]
[ext_resource type="Script" uid="uid://cw0jlq5d8r66g" path="res://scripts/structure.gd" id="2_a2t3e"]
[resource]
script = ExtResource("2_a2t3e")
title = ""
model = ExtResource("1_klt7o")
type = 1
price = 60
@ -12,3 +13,6 @@ population_count = 1
kW_usage = 1.0
kW_production = 0.0
selector_scale = 2.8
unlocked = false
description = "Description"
thumbnail = "Thumbnail"

@ -1,10 +1,11 @@
[gd_resource type="Resource" script_class="Structure" load_steps=3 format=3 uid="uid://bh65eqgid4kxy"]
[ext_resource type="PackedScene" uid="uid://m74mvao50wnm" path="res://models/building-small-c.glb" id="1_6yyww"]
[ext_resource type="Script" uid="uid://smbpvh2nwds4" path="res://scripts/structure.gd" id="2_rkiq0"]
[ext_resource type="Script" uid="uid://cw0jlq5d8r66g" path="res://scripts/structure.gd" id="2_rkiq0"]
[resource]
script = ExtResource("2_rkiq0")
title = ""
model = ExtResource("1_6yyww")
type = 1
price = 70
@ -12,3 +13,6 @@ population_count = 1
kW_usage = 1.0
kW_production = 0.0
selector_scale = 2.8
unlocked = false
description = "Description"
thumbnail = "Thumbnail"

@ -1,10 +1,11 @@
[gd_resource type="Resource" script_class="Structure" load_steps=3 format=3 uid="uid://dtal0tl2ee336"]
[ext_resource type="PackedScene" uid="uid://h0vrvst3cumo" path="res://models/building-small-d.glb" id="1_164xq"]
[ext_resource type="Script" uid="uid://smbpvh2nwds4" path="res://scripts/structure.gd" id="2_8ewai"]
[ext_resource type="Script" uid="uid://cw0jlq5d8r66g" path="res://scripts/structure.gd" id="2_8ewai"]
[resource]
script = ExtResource("2_8ewai")
title = ""
model = ExtResource("1_164xq")
type = 1
price = 70
@ -12,3 +13,6 @@ population_count = 1
kW_usage = 1.0
kW_production = 0.0
selector_scale = 2.8
unlocked = false
description = "Description"
thumbnail = "Thumbnail"

@ -1,10 +1,11 @@
[gd_resource type="Resource" script_class="Structure" load_steps=3 format=3 uid="uid://y6jafhfnhbrp"]
[ext_resource type="PackedScene" uid="uid://dy26b1ba2j2v1" path="res://models/grass-trees-tall.glb" id="1_nbdd1"]
[ext_resource type="Script" uid="uid://smbpvh2nwds4" path="res://scripts/structure.gd" id="2_b2sah"]
[ext_resource type="Script" uid="uid://cw0jlq5d8r66g" path="res://scripts/structure.gd" id="2_b2sah"]
[resource]
script = ExtResource("2_b2sah")
title = ""
model = ExtResource("1_nbdd1")
type = 6
price = 25
@ -12,3 +13,6 @@ population_count = 0
kW_usage = 0.0
kW_production = 0.0
selector_scale = 2.8
unlocked = false
description = "Description"
thumbnail = "Thumbnail"

@ -1,7 +1,7 @@
[gd_resource type="Resource" script_class="Structure" load_steps=3 format=3 uid="uid://ccb475jeg7ym5"]
[ext_resource type="PackedScene" uid="uid://b1711sieed2u6" path="res://models/grass-trees.glb" id="1_lcgc1"]
[ext_resource type="Script" path="res://scripts/structure.gd" id="2_pnpij"]
[ext_resource type="Script" uid="uid://cw0jlq5d8r66g" path="res://scripts/structure.gd" id="2_pnpij"]
[resource]
script = ExtResource("2_pnpij")

@ -1,10 +1,11 @@
[gd_resource type="Resource" script_class="Structure" load_steps=3 format=3 uid="uid://tm532uesguhk"]
[ext_resource type="PackedScene" uid="uid://cr3btp34bp3eg" path="res://models/grass.glb" id="1_2n0ef"]
[ext_resource type="Script" uid="uid://smbpvh2nwds4" path="res://scripts/structure.gd" id="2_1i4lf"]
[ext_resource type="Script" uid="uid://cw0jlq5d8r66g" path="res://scripts/structure.gd" id="2_1i4lf"]
[resource]
script = ExtResource("2_1i4lf")
title = ""
model = ExtResource("1_2n0ef")
type = 6
price = 10
@ -14,4 +15,4 @@ kW_production = 0.0
selector_scale = 2.8
unlocked = false
description = "Some lush green grass!"
thumbnail = "res://sprites/residential/grass.png"
thumbnail = "res://sprites/residential/grass.png"

Some files were not shown because too many files have changed in this diff Show More