Merge remote-tracking branch 'refs/remotes/origin/main'

This commit is contained in:
Dusk 2026-03-06 09:14:04 +01:00
commit 2ca1c3f625
31 changed files with 2049 additions and 1469 deletions

BIN
assets/3d/Tree.glb (Stored with Git LFS) Normal file

Binary file not shown.

42
assets/3d/Tree.glb.import Normal file
View File

@ -0,0 +1,42 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://bp5416wnjuue1"
path="res://.godot/imported/Tree.glb-ee2d55d8b3c1e9949bbea10c69d9d7d2.scn"
[deps]
source_file="res://assets/3d/Tree.glb"
dest_files=["res://.godot/imported/Tree.glb-ee2d55d8b3c1e9949bbea10c69d9d7d2.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/root_script=null
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_name_suffixes=true
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
materials/extract=0
materials/extract_format=0
materials/extract_path=""
_subresources={}
gltf/naming_version=2
gltf/embedded_image_handling=1

BIN
assets/3d/Tree_tree_texture.png (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,44 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dq7bfl67j5siu"
path.s3tc="res://.godot/imported/Tree_tree_texture.png-a8241c5ce28dd6662164d1d3679db874.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
generator_parameters={
"md5": "e8869372908c5e95a7d127e20dd0f35d"
}
[deps]
source_file="res://assets/3d/Tree_tree_texture.png"
dest_files=["res://.godot/imported/Tree_tree_texture.png-a8241c5ce28dd6662164d1d3679db874.s3tc.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0

View File

@ -0,0 +1,21 @@
[gd_resource type="StandardMaterial3D" format=3 uid="uid://bg53mkecyq7sk"]
[ext_resource type="Texture2D" uid="uid://baythxq70k2ud" path="res://assets/Images/pavement/PavingStones074_1K-JPG_AmbientOcclusion.jpg" id="AmbientOcclusion"]
[ext_resource type="Texture2D" uid="uid://uhin1s6yxdvm" path="res://assets/Images/pavement/PavingStones074_1K-JPG_Color.jpg" id="Color"]
[ext_resource type="Texture2D" uid="uid://bgjlj84sjycr4" path="res://assets/Images/pavement/PavingStones074_1K-JPG_Displacement.jpg" id="Displacement"]
[ext_resource type="Texture2D" uid="uid://b5wh17v55dajm" path="res://assets/Images/pavement/PavingStones074_1K-JPG_NormalGL.jpg" id="NormalGL"]
[ext_resource type="Texture2D" uid="uid://wutu5iep0s3b" path="res://assets/Images/pavement/PavingStones074_1K-JPG_Roughness.jpg" id="Roughness"]
[resource]
albedo_texture = ExtResource("Color")
roughness_texture = ExtResource("Roughness")
roughness_texture_channel = 4
normal_enabled = true
normal_texture = ExtResource("NormalGL")
ao_enabled = true
ao_texture = ExtResource("AmbientOcclusion")
ao_texture_channel = 4
heightmap_enabled = true
heightmap_scale = 1.0
heightmap_texture = ExtResource("Displacement")
uv1_scale = Vector3(22.333, 17.37, 22.625)

View File

@ -0,0 +1,21 @@
[gd_resource type="StandardMaterial3D" format=3 uid="uid://pi37nbc20kiw"]
[ext_resource type="Texture2D" uid="uid://uhin1s6yxdvm" path="res://assets/Images/pavement/PavingStones074_1K-JPG_Color.jpg" id="1_movv3"]
[ext_resource type="Texture2D" uid="uid://baythxq70k2ud" path="res://assets/Images/pavement/PavingStones074_1K-JPG_AmbientOcclusion.jpg" id="2_qtsmd"]
[ext_resource type="Texture2D" uid="uid://bgjlj84sjycr4" path="res://assets/Images/pavement/PavingStones074_1K-JPG_Displacement.jpg" id="3_g005f"]
[ext_resource type="Texture2D" uid="uid://b5wh17v55dajm" path="res://assets/Images/pavement/PavingStones074_1K-JPG_NormalGL.jpg" id="4_uxvby"]
[ext_resource type="Texture2D" uid="uid://wutu5iep0s3b" path="res://assets/Images/pavement/PavingStones074_1K-JPG_Roughness.jpg" id="5_4k0kd"]
[resource]
albedo_texture = ExtResource("1_movv3")
roughness_texture = ExtResource("5_4k0kd")
roughness_texture_channel = 4
normal_enabled = true
normal_texture = ExtResource("4_uxvby")
ao_enabled = true
ao_texture = ExtResource("2_qtsmd")
ao_texture_channel = 4
heightmap_enabled = true
heightmap_scale = 1.0
heightmap_texture = ExtResource("3_g005f")
uv1_scale = Vector3(22.333, 35.145, 22.35)

Binary file not shown.

View File

@ -0,0 +1,41 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://baythxq70k2ud"
path.s3tc="res://.godot/imported/PavingStones074_1K-JPG_AmbientOcclusion.jpg-6de0de4bdd0e16ffed1a0604334cbe06.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://assets/Images/pavement/PavingStones074_1K-JPG_AmbientOcclusion.jpg"
dest_files=["res://.godot/imported/PavingStones074_1K-JPG_AmbientOcclusion.jpg-6de0de4bdd0e16ffed1a0604334cbe06.s3tc.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=8
roughness/src_normal="res://assets/Images/pavement/PavingStones074_1K-JPG_NormalGL.jpg"
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0

BIN
assets/Images/pavement/PavingStones074_1K-JPG_Color.jpg (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,41 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://uhin1s6yxdvm"
path.s3tc="res://.godot/imported/PavingStones074_1K-JPG_Color.jpg-13c1dbf40ab4bc793b818eae6beba097.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://assets/Images/pavement/PavingStones074_1K-JPG_Color.jpg"
dest_files=["res://.godot/imported/PavingStones074_1K-JPG_Color.jpg-13c1dbf40ab4bc793b818eae6beba097.s3tc.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0

Binary file not shown.

View File

@ -0,0 +1,41 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bgjlj84sjycr4"
path.s3tc="res://.godot/imported/PavingStones074_1K-JPG_Displacement.jpg-a29c70781d462c14bfb0134541962aca.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://assets/Images/pavement/PavingStones074_1K-JPG_Displacement.jpg"
dest_files=["res://.godot/imported/PavingStones074_1K-JPG_Displacement.jpg-a29c70781d462c14bfb0134541962aca.s3tc.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=7
roughness/src_normal="res://assets/Images/pavement/PavingStones074_1K-JPG_NormalGL.jpg"
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0

BIN
assets/Images/pavement/PavingStones074_1K-JPG_NormalGL.jpg (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,41 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b5wh17v55dajm"
path.s3tc="res://.godot/imported/PavingStones074_1K-JPG_NormalGL.jpg-96eab16b3ba34f6a8bd894453cc7d375.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://assets/Images/pavement/PavingStones074_1K-JPG_NormalGL.jpg"
dest_files=["res://.godot/imported/PavingStones074_1K-JPG_NormalGL.jpg-96eab16b3ba34f6a8bd894453cc7d375.s3tc.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=1
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=1
roughness/src_normal="res://assets/Images/pavement/PavingStones074_1K-JPG_NormalGL.jpg"
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0

BIN
assets/Images/pavement/PavingStones074_1K-JPG_Roughness.jpg (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,41 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://wutu5iep0s3b"
path.s3tc="res://.godot/imported/PavingStones074_1K-JPG_Roughness.jpg-ee804b9389ae02541489c0d4c407358f.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://assets/Images/pavement/PavingStones074_1K-JPG_Roughness.jpg"
dest_files=["res://.godot/imported/PavingStones074_1K-JPG_Roughness.jpg-ee804b9389ae02541489c0d4c407358f.s3tc.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0

File diff suppressed because it is too large Load Diff

1
cc.txt
View File

@ -1,3 +1,4 @@
Rails by dook [CC-BY] (https://creativecommons.org/licenses/by/3.0/) via Poly Pizza (https://poly.pizza/m/5JTOJuMHJw)
Jim the Linux Penguin by Rebekah Yoder is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Drink Tea SVG Vector by Zlatko Najdenovski is licensed under a Creative COmmons Attribution International License.
Tree by Poly by Google [CC-BY] (https://creativecommons.org/licenses/by/3.0/) via Poly Pizza (https://poly.pizza/m/6pwiq7hSrHr)

View File

@ -6,6 +6,7 @@ var exits: Array = [false, false, false, false]
const STREET_WIDTH: float = 40
@onready var exit_area = $BuildingAreas/B_area_E/Collision
@onready var building_area = $BuildingAreas/B_area/Collision
var building_scn = preload("res://building.tscn")
func _ready() -> void:
$Mesh.mesh.size.x = Global.chunk_size
@ -30,6 +31,11 @@ func _ready() -> void:
$BuildingAreas.add_child(new_area)
func update() -> void:
$BuildingAreas/B_area_N/Building.visible = true
$BuildingAreas/B_area_S/Building.visible = true
$BuildingAreas/B_area_E/Building.visible = true
$BuildingAreas/B_area_W/Building.visible = true
var i = 0
for exit in exits:
if not exit:
@ -37,90 +43,16 @@ func update() -> void:
continue
if i == 0: #n
var vertices = PackedVector3Array()
vertices.push_back(Vector3(-STREET_WIDTH/2, 0.5, -Global.chunk_size/2))
vertices.push_back(Vector3(STREET_WIDTH/2 , 0.5, -Global.chunk_size/2))
vertices.push_back(Vector3(-STREET_WIDTH/2, 0.5, 0))
vertices.push_back(Vector3(STREET_WIDTH/2, 0.5, -Global.chunk_size/2))
vertices.push_back(Vector3(STREET_WIDTH/2, 0.5, 0))
vertices.push_back(Vector3(-STREET_WIDTH/2, 0.5, 0))
# Initialize the ArrayMesh.
var arr_mesh = ArrayMesh.new()
var arrays = []
arrays.resize(Mesh.ARRAY_MAX)
arrays[Mesh.ARRAY_VERTEX] = vertices
# Create the Mesh.
arr_mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, arrays)
var m = MeshInstance3D.new()
m.mesh = arr_mesh
add_child(m)
$BuildingAreas/B_area_N/Collision.disabled = true
$BuildingAreas/B_area_N/Building.visible = false
if i == 1: #s
var vertices = PackedVector3Array()
vertices.push_back(Vector3(-STREET_WIDTH/2, 0.5, 0))
vertices.push_back(Vector3(STREET_WIDTH/2, 0.5, 0))
vertices.push_back(Vector3(-STREET_WIDTH/2, 0.5, Global.chunk_size/2))
vertices.push_back(Vector3(STREET_WIDTH/2, 0.5, 0))
vertices.push_back(Vector3(STREET_WIDTH/2, 0.5, Global.chunk_size/2))
vertices.push_back(Vector3(-STREET_WIDTH/2, 0.5, Global.chunk_size/2))
# Initialize the ArrayMesh.
var arr_mesh = ArrayMesh.new()
var arrays = []
arrays.resize(Mesh.ARRAY_MAX)
arrays[Mesh.ARRAY_VERTEX] = vertices
# Create the Mesh.
arr_mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, arrays)
var m = MeshInstance3D.new()
m.mesh = arr_mesh
add_child(m)
$BuildingAreas/B_area_S/Collision.disabled = true
$BuildingAreas/B_area_S/Building.visible = false
if i == 2: #w
var vertices = PackedVector3Array()
vertices.push_back(Vector3(-Global.chunk_size/2, 0.5, -STREET_WIDTH/2))
vertices.push_back(Vector3(0, 0.5, -STREET_WIDTH/2))
vertices.push_back(Vector3(-Global.chunk_size/2, 0.5, STREET_WIDTH/2))
vertices.push_back(Vector3(0, 0.5, -STREET_WIDTH/2))
vertices.push_back(Vector3(0, 0.5, STREET_WIDTH/2))
vertices.push_back(Vector3(-Global.chunk_size/2, 0.5, STREET_WIDTH/2))
# Initialize the ArrayMesh.
var arr_mesh = ArrayMesh.new()
var arrays = []
arrays.resize(Mesh.ARRAY_MAX)
arrays[Mesh.ARRAY_VERTEX] = vertices
# Create the Mesh.
arr_mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, arrays)
var m = MeshInstance3D.new()
m.mesh = arr_mesh
add_child(m)
$BuildingAreas/B_area_W/Collision.disabled = true
$BuildingAreas/B_area_W/Building.visible = false
if i == 3: #e
var vertices = PackedVector3Array()
vertices.push_back(Vector3(0, 0.5, -STREET_WIDTH/2))
vertices.push_back(Vector3(Global.chunk_size/2, 0.5, -STREET_WIDTH/2))
vertices.push_back(Vector3(0, 0.5, STREET_WIDTH/2))
vertices.push_back(Vector3(Global.chunk_size/2, 0.5, -STREET_WIDTH/2))
vertices.push_back(Vector3(Global.chunk_size/2, 0.5, STREET_WIDTH/2))
vertices.push_back(Vector3(0, 0.5, STREET_WIDTH/2))
# Initialize the ArrayMesh.
var arr_mesh = ArrayMesh.new()
var arrays = []
arrays.resize(Mesh.ARRAY_MAX)
arrays[Mesh.ARRAY_VERTEX] = vertices
# Create the Mesh.
arr_mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, arrays)
var m = MeshInstance3D.new()
m.mesh = arr_mesh
add_child(m)
$BuildingAreas/B_area_E/Collision.disabled = true
var center_mesh = MeshInstance3D.new()
center_mesh.position = Vector3(0,0.6,0)
center_mesh.mesh = PlaneMesh.new()
center_mesh.mesh.size = Vector2(STREET_WIDTH,STREET_WIDTH)
add_child(center_mesh)
$BuildingAreas/B_area_E/Building.visible = false
i += 1

View File

@ -1,12 +1,15 @@
[gd_scene format=3 uid="uid://cqbu5r5pmnhc"]
[ext_resource type="Script" uid="uid://ndadug5eerju" path="res://chunk.gd" id="1_kdh3y"]
[ext_resource type="PackedScene" uid="uid://da60ofnpg72ua" path="res://building.tscn" id="2_eat54"]
[ext_resource type="Material" uid="uid://bg53mkecyq7sk" path="res://assets/Images/pavement/PavingStones074_1K-JPG.tres" id="3_a0kup"]
[ext_resource type="Material" uid="uid://pi37nbc20kiw" path="res://assets/Images/pavement/PavingStones074_1K-JPG2.tres" id="4_7yqgf"]
[sub_resource type="PlaneMesh" id="PlaneMesh_kdh3y"]
size = Vector2(150, 150)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_eoxb4"]
albedo_color = Color(0.47398567, 0.32202998, 0.25116646, 1)
albedo_color = Color(0, 0, 0, 1)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_kdh3y"]
albedo_color = Color(0, 0, 1, 1)
@ -30,9 +33,19 @@ albedo_color = Color(0, 0, 1, 1)
[sub_resource type="BoxShape3D" id="BoxShape3D_kdh3y"]
size = Vector3(55, 50, 55)
[sub_resource type="BoxMesh" id="BoxMesh_381vs"]
lightmap_size_hint = Vector2i(479, 391)
material = ExtResource("3_a0kup")
size = Vector3(65, 1, 65)
[sub_resource type="BoxShape3D" id="BoxShape3D_a0kup"]
size = Vector3(55, 50, 40)
[sub_resource type="BoxMesh" id="BoxMesh_7yqgf"]
lightmap_size_hint = Vector2i(479, 391)
material = ExtResource("4_7yqgf")
size = Vector3(65, 1, 65)
[node name="Chunk" type="Node3D" unique_id=1195945545]
script = ExtResource("1_kdh3y")
@ -74,12 +87,26 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 47.5, 0, 47.5)
shape = SubResource("BoxShape3D_kdh3y")
debug_color = Color(0.7365185, 0.46945518, 0, 0.41960785)
[node name="Building" parent="BuildingAreas/B_area" unique_id=228050854 instance=ExtResource("2_eat54")]
transform = Transform3D(1.0948861, 0, 0, 0, 1.0948861, 0, 0, 0, 1.0948861, 47.70289, 2.3668175, 47.375614)
[node name="MeshInstance3D" type="MeshInstance3D" parent="BuildingAreas/B_area/Building" unique_id=1041049709]
transform = Transform3D(0.9133367, 0, 0, 0, 0.9133367, 0, 0, 0, 0.9133367, -4.9015274, -2.236999, -4.4171753)
mesh = SubResource("BoxMesh_381vs")
[node name="B_area_E" type="StaticBody3D" parent="BuildingAreas" unique_id=164651542]
[node name="Collision" type="CollisionShape3D" parent="BuildingAreas/B_area_E" unique_id=2080946797]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 47.5, 0, 0)
shape = SubResource("BoxShape3D_a0kup")
[node name="Building" parent="BuildingAreas/B_area_E" unique_id=496327803 instance=ExtResource("2_eat54")]
transform = Transform3D(1.1296118, 0, 0, 0, 1.0989345, 0, 0, 0, 0.8093087, 47.032215, 2.198969, 0)
[node name="MeshInstance3D" type="MeshInstance3D" parent="BuildingAreas/B_area_E/Building" unique_id=2097051923]
transform = Transform3D(0.7908016, 0, 0, 0, 0.9999995, 0, 0, 0, 2.8399127, -7.5103607, -2.0044072, 0)
mesh = SubResource("BoxMesh_7yqgf")
[node name="B_area_W" type="StaticBody3D" parent="BuildingAreas" unique_id=1412614477]
transform = Transform3D(-1, 0, 8.742278e-08, 0, 1, 0, -8.742278e-08, 0, -1, 0, 0, 0)
@ -87,6 +114,13 @@ transform = Transform3D(-1, 0, 8.742278e-08, 0, 1, 0, -8.742278e-08, 0, -1, 0, 0
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 47.5, 0, 0)
shape = SubResource("BoxShape3D_a0kup")
[node name="Building" parent="BuildingAreas/B_area_W" unique_id=1691268780 instance=ExtResource("2_eat54")]
transform = Transform3D(1.1296118, 0, 0, 0, 1.0989345, 0, 0, 0, 0.8093087, 47.032215, 2.198969, 0)
[node name="MeshInstance3D" type="MeshInstance3D" parent="BuildingAreas/B_area_W/Building" unique_id=1625091819]
transform = Transform3D(0.7908016, 0, 0, 0, 0.9999995, 0, 0, 0, 2.8399127, -7.5103607, -2.0044072, 0)
mesh = SubResource("BoxMesh_7yqgf")
[node name="B_area_S" type="StaticBody3D" parent="BuildingAreas" unique_id=1192841263]
transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 0, 0, 0)
@ -94,9 +128,23 @@ transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 0, 0
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 47.5, 0, 0)
shape = SubResource("BoxShape3D_a0kup")
[node name="Building" parent="BuildingAreas/B_area_S" unique_id=819634987 instance=ExtResource("2_eat54")]
transform = Transform3D(1.1296118, 0, 0, 0, 1.0989345, 0, 0, 0, 0.8093087, 47.032215, 2.198969, 0)
[node name="MeshInstance3D" type="MeshInstance3D" parent="BuildingAreas/B_area_S/Building" unique_id=1325249889]
transform = Transform3D(0.7908016, 0, 0, 0, 0.9999995, 0, 0, 0, 2.8399127, -7.5103607, -2.0044072, 0)
mesh = SubResource("BoxMesh_7yqgf")
[node name="B_area_N" type="StaticBody3D" parent="BuildingAreas" unique_id=1360962540]
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 0, 0, 0)
[node name="Collision" type="CollisionShape3D" parent="BuildingAreas/B_area_N" unique_id=1952010205]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 47.5, 0, 0)
shape = SubResource("BoxShape3D_a0kup")
[node name="Building" parent="BuildingAreas/B_area_N" unique_id=737365486 instance=ExtResource("2_eat54")]
transform = Transform3D(1.1296118, 0, 0, 0, 1.0989345, 0, 0, 0, 0.8093087, 47.032215, 2.198969, 0)
[node name="MeshInstance3D" type="MeshInstance3D" parent="BuildingAreas/B_area_N/Building" unique_id=1889416504]
transform = Transform3D(0.7908016, 0, 0, 0, 0.9999995, 0, 0, 0, 2.8399127, -7.5103607, -2.0044072, 0)
mesh = SubResource("BoxMesh_7yqgf")

View File

@ -35,7 +35,9 @@ var is_active: bool = true
func _ready() -> void:
$Upgrades.update()
$SpecialUpgrades.update()
$Shop.upgrade_node = $Upgrades
$Shop.special_upgrade_node = $SpecialUpgrades
$Shop.populate()
$Shop.visible = false
@ -129,6 +131,7 @@ func _on_retry_button_pressed():
is_active = true
$TimeLimit.start()
$Upgrades.reset()
$SpecialUpgrades.reset()
stamina = max_stamina

View File

@ -1,6 +1,7 @@
[gd_scene format=3 uid="uid://cmb3b7xrlboy3"]
[ext_resource type="Script" uid="uid://bobw4cfg1v6gj" path="res://player.gd" id="1_4flbx"]
[ext_resource type="PackedScene" uid="uid://byv518wlck1t4" path="res://special_upgrades.tscn" id="2_hqtel"]
[ext_resource type="PackedScene" uid="uid://52hoyqjot1cs" path="res://shop.tscn" id="2_i3pqv"]
[ext_resource type="PackedScene" uid="uid://ct7cc7qg3hpu1" path="res://upgrades.tscn" id="2_onrkg"]
[ext_resource type="Texture2D" uid="uid://bpfvioqm4kbv8" path="res://assets/Images/arrow.png" id="4_hqtel"]
@ -34,7 +35,9 @@ collision_layer = 4
collision_mask = 3
script = ExtResource("1_4flbx")
[node name="Upgrades" parent="." unique_id=1238785974 instance=ExtResource("2_onrkg")]
[node name="SpecialUpgrades" parent="." unique_id=1238785974 instance=ExtResource("2_hqtel")]
[node name="Upgrades" parent="." unique_id=1484491196 instance=ExtResource("2_onrkg")]
[node name="Mesh" type="MeshInstance3D" parent="." unique_id=1740724392]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.1, 0)

61
shop.gd
View File

@ -1,12 +1,19 @@
extends Control
var upgrade_node: Node
var special_upgrade_node: Node
var available_money: int = 0
var special_currency: int = 0
signal shop_exit
func _ready() -> void:
$Tux.visible = true
$Xenia.visible = true
$TuxUpgrades.visible = false
$XeniaUpgrades.visible = false
func _process(delta: float) -> void:
$Money.text = str(available_money)
$SpecialMoney.text = str(special_currency)
@ -21,15 +28,23 @@ func populate() -> void:
if upgrade.enabled:
$TuxUpgrades.set_item_disabled(index, true)
$XeniaUpgrades.clear()
for upgrade in special_upgrade_node.get_children():
var index = $XeniaUpgrades.add_item(upgrade.upgrade_description + " Cost: " + str(upgrade.cost), upgrade.icon)
$XeniaUpgrades.set_item_metadata(index, upgrade)
if upgrade.enabled:
$XeniaUpgrades.set_item_disabled(index, true)
func _on_tux_mouse_entered() -> void:
$Tux.modulate = Color(0.5, 0.5, 0.6)
func _on_xenia_mouse_entered() -> void:
$Xenia.modulate = Color(0.5, 0.5, 0.6)
func _on_tux_mouse_exited() -> void:
$Tux.modulate = Color(1, 1, 1)
$Tux.modulate = Color(1.0, 1.0, 1.0)
func _on_xenia_mouse_exited() -> void:
$Xenia.modulate = Color(1.0, 1.0, 1.0)
func _on_tux_upgrades_item_clicked(index: int, at_position: Vector2, mouse_button_index: int) -> void:
@ -38,26 +53,36 @@ func _on_tux_upgrades_item_clicked(index: int, at_position: Vector2, mouse_butto
upgrade.enabled = true;
available_money -= upgrade.cost
populate()
$Error.text = ""
else:
$Error.text = "No tens prou Diners!!!!"
func _on_continue_pressed() -> void:
$Tux.visible = true
$Xenia.visible = true
$TuxUpgrades.visible = false
shop_exit.emit()
func _on_xenia_mouse_entered() -> void:
$Xenia.modulate = Color(0.5, 0.5, 0.6)
func _on_xenia_mouse_exited() -> void:
$Xenia.modulate = Color(1, 1, 1)
func _on_xenia_upgrades_item_clicked(index: int, at_position: Vector2, mouse_button_index: int) -> void:
var upgrade = $XeniaUpgrades.get_item_metadata(index)
if upgrade.cost <= special_currency:
upgrade.enabled = true;
special_currency -= upgrade.cost
populate()
$Error.text = ""
else:
$Error.text = "No tens prou 🥘!!!!"
func _on_tux_pressed() -> void:
$Tux.visible = false
$Xenia.visible = false
$TuxUpgrades.visible = true
func _on_xenia_pressed():
$Tux.visible = false
$Xenia.visible = false
$XeniaUpgrades.visible = true
func _on_continue_pressed() -> void:
$Error.text = ""
$Tux.visible = true
$Xenia.visible = true
$TuxUpgrades.visible = false
$XeniaUpgrades.visible = false
shop_exit.emit()

View File

@ -99,7 +99,6 @@ theme_override_font_sizes/font_size = 40
text = "Tenda de XENIA"
[node name="TuxUpgrades" type="ItemList" parent="." unique_id=351105576]
visible = false
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
@ -114,6 +113,21 @@ grow_horizontal = 2
grow_vertical = 2
fixed_icon_size = Vector2i(100, 100)
[node name="XeniaUpgrades" type="ItemList" parent="." unique_id=1728782891]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = 109.0
offset_top = -295.0
offset_right = 492.0
offset_bottom = 288.0
grow_horizontal = 2
grow_vertical = 2
fixed_icon_size = Vector2i(100, 100)
[node name="Pessetes" type="Label" parent="." unique_id=1267923551]
layout_mode = 0
offset_left = 205.0
@ -195,5 +209,7 @@ text = "Continuar"
[connection signal="pressed" from="Tux" to="." method="_on_tux_pressed"]
[connection signal="mouse_entered" from="Xenia" to="." method="_on_xenia_mouse_entered"]
[connection signal="mouse_exited" from="Xenia" to="." method="_on_xenia_mouse_exited"]
[connection signal="pressed" from="Xenia" to="." method="_on_xenia_pressed"]
[connection signal="item_clicked" from="TuxUpgrades" to="." method="_on_tux_upgrades_item_clicked"]
[connection signal="item_clicked" from="XeniaUpgrades" to="." method="_on_xenia_upgrades_item_clicked"]
[connection signal="pressed" from="Continue" to="." method="_on_continue_pressed"]

View File

@ -1,6 +1,7 @@
[gd_scene format=3 uid="uid://m45422rsfnmh"]
[ext_resource type="Script" uid="uid://dixivehd47h0o" path="res://spawn.gd" id="1_3a72r"]
[ext_resource type="PackedScene" uid="uid://cw1io6sune5u8" path="res://tree.tscn" id="2_yqulk"]
[sub_resource type="PlaneMesh" id="PlaneMesh_kdh3y"]
size = Vector2(150, 150)
@ -14,3 +15,39 @@ script = ExtResource("1_3a72r")
[node name="Mesh" type="MeshInstance3D" parent="." unique_id=651037282]
mesh = SubResource("PlaneMesh_kdh3y")
surface_material_override/0 = SubResource("StandardMaterial3D_eoxb4")
[node name="Tree" parent="." unique_id=1643526032 instance=ExtResource("2_yqulk")]
transform = Transform3D(-0.25, 0, 2.1855694e-08, 0, 0.25, 0, -2.1855694e-08, 0, -0.25, 56.65297, 0, 58.980564)
[node name="Tree2" parent="." unique_id=1540661030 instance=ExtResource("2_yqulk")]
transform = Transform3D(-1.0927847e-08, 0, -0.25, 0, 0.25, 0, 0.25, 0, -1.0927847e-08, -58.315056, 0, 58.980564)
[node name="Tree3" parent="." unique_id=733885099 instance=ExtResource("2_yqulk")]
transform = Transform3D(-1.0927847e-08, 0, 0.25, 0, 0.25, 0, -0.25, 0, -1.0927847e-08, 56.65297, 0, -59.754894)
[node name="Tree4" parent="." unique_id=1749315975 instance=ExtResource("2_yqulk")]
transform = Transform3D(0.25, 0, 0, 0, 0.25, 0, 0, 0, 0.25, -58.315056, 0, -59.754894)
[node name="Tree5" parent="." unique_id=548660262 instance=ExtResource("2_yqulk")]
transform = Transform3D(0.25, 0, 0, 0, 0.25, 0, 0, 0, 0.25, 56.65297, 0, 20.611866)
[node name="Tree6" parent="." unique_id=60264276 instance=ExtResource("2_yqulk")]
transform = Transform3D(0.25, 0, 0, 0, 0.25, 0, 0, 0, 0.25, -58.315056, 0, 20.611866)
[node name="Tree7" parent="." unique_id=474542968 instance=ExtResource("2_yqulk")]
transform = Transform3D(-1.0927847e-08, 0, -0.25, 0, 0.25, 0, 0.25, 0, -1.0927847e-08, 56.65297, 0, -19.729847)
[node name="Tree8" parent="." unique_id=1315362359 instance=ExtResource("2_yqulk")]
transform = Transform3D(-1.0927847e-08, 0, 0.25, 0, 0.25, 0, -0.25, 0, -1.0927847e-08, -58.315056, 0, -19.729847)
[node name="Tree9" parent="." unique_id=966257851 instance=ExtResource("2_yqulk")]
transform = Transform3D(-0.25, 0, 2.1855694e-08, 0, 0.25, 0, -2.1855694e-08, 0, -0.25, -21.001902, 0, 59.295353)
[node name="Tree10" parent="." unique_id=1132289865 instance=ExtResource("2_yqulk")]
transform = Transform3D(-0.25, 0, 2.5580984e-08, 0, 0.25, 0, -2.5580984e-08, 0, -0.25, -21.001898, 0, -60.134964)
[node name="Tree11" parent="." unique_id=652494687 instance=ExtResource("2_yqulk")]
transform = Transform3D(-1.0927847e-08, 0, -0.25, 0, 0.25, 0, 0.25, 0, -1.0927847e-08, 19.339811, 0, 59.295353)
[node name="Tree12" parent="." unique_id=235943393 instance=ExtResource("2_yqulk")]
transform = Transform3D(-1.0927847e-08, 0, -0.25, 0, 0.25, 0, 0.25, 0, -1.0927847e-08, 19.339815, 0, -60.134964)

21
special_upgrades.gd Normal file
View File

@ -0,0 +1,21 @@
extends Node
var parent: CharacterBody3D
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
assert(get_parent().name == "Player", "Upgrade must have player as parent")
parent = get_parent()
func update() -> void:
var upgrades: Array = get_children()
print("Updating all upgrades...")
for upgrade in upgrades:
upgrade.update()
func reset():
var upgrades: Array = get_children()
print("Updating all upgrades...")
for upgrade in upgrades:
upgrade.enabled = false

1
special_upgrades.gd.uid Normal file
View File

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

24
special_upgrades.tscn Normal file
View File

@ -0,0 +1,24 @@
[gd_scene format=3 uid="uid://byv518wlck1t4"]
[ext_resource type="Script" uid="uid://bxvhar7bgeyau" path="res://special_upgrades.gd" id="1_76f4f"]
[sub_resource type="GDScript" id="GDScript_8j6ry"]
script/source = "extends Node
var enabled: bool = false
var cost: int = 3
var upgrade_name: String = \"Tamany bloc\"
var upgrade_description: String = \"Fa mes xicotet cada bloc\"
var icon: Texture2D = preload(\"res://assets/Images/tren.jpg\")
func update() -> void:
if enabled:
print(\"Updating chunk size\")
Global.chunk_size = 120
"
[node name="SpecialUpgrades" type="Node" unique_id=1238785974]
script = ExtResource("1_76f4f")
[node name="ChunkSize" type="Node" parent="." unique_id=1030985851]
script = SubResource("GDScript_8j6ry")

View File

@ -1,6 +1,7 @@
[gd_scene format=3 uid="uid://cf50vwp60vxxf"]
[ext_resource type="Script" uid="uid://e3kpo73hvthu" path="res://station.gd" id="1_lu35c"]
[ext_resource type="Material" uid="uid://pi37nbc20kiw" path="res://assets/Images/pavement/PavingStones074_1K-JPG2.tres" id="2_oblqs"]
[ext_resource type="PackedScene" uid="uid://8227la7x8kn1" path="res://assets/3d/Rails.glb" id="2_xmj61"]
[ext_resource type="Texture2D" uid="uid://dwp08vjv8v6h6" path="res://icon.svg" id="3_sum1q"]
@ -77,6 +78,7 @@ size = Vector3(16.840843, 19.235413, 1)
script = ExtResource("1_lu35c")
[node name="Mesh" type="MeshInstance3D" parent="." unique_id=651037282]
material_override = ExtResource("2_oblqs")
mesh = SubResource("PlaneMesh_kdh3y")
surface_material_override/0 = SubResource("StandardMaterial3D_eoxb4")

54
tree.tscn Normal file
View File

@ -0,0 +1,54 @@
[gd_scene format=3 uid="uid://cw1io6sune5u8"]
[ext_resource type="PackedScene" uid="uid://bp5416wnjuue1" path="res://assets/3d/Tree.glb" id="1_brfkd"]
[sub_resource type="BoxMesh" id="BoxMesh_brfkd"]
size = Vector3(20, 2, 20)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_nnvrw"]
albedo_color = Color(0.24176407, 0.16295472, 0.12468862, 1)
[sub_resource type="BoxMesh" id="BoxMesh_gvmkm"]
size = Vector3(22, 2, 2)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_d2g23"]
albedo_color = Color(0.39, 0.39, 0.39, 1)
[sub_resource type="BoxShape3D" id="BoxShape3D_brfkd"]
size = Vector3(22, 54.24121, 22)
[node name="Tree" type="Node3D" unique_id=1643526032]
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0)
[node name="Tree" parent="." unique_id=1223026190 instance=ExtResource("1_brfkd")]
transform = Transform3D(0.1, 0, 0, 0, 0.1, 0, 0, 0, 0.1, 0, 0, 0)
[node name="Mesh" type="MeshInstance3D" parent="." unique_id=105535720]
mesh = SubResource("BoxMesh_brfkd")
surface_material_override/0 = SubResource("StandardMaterial3D_nnvrw")
[node name="Mesh2" type="MeshInstance3D" parent="Mesh" unique_id=1501168588]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 10)
mesh = SubResource("BoxMesh_gvmkm")
surface_material_override/0 = SubResource("StandardMaterial3D_d2g23")
[node name="Mesh" type="MeshInstance3D" parent="Mesh" unique_id=382879196]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, -10)
mesh = SubResource("BoxMesh_gvmkm")
surface_material_override/0 = SubResource("StandardMaterial3D_d2g23")
[node name="Mesh3" type="MeshInstance3D" parent="Mesh" unique_id=370187374]
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 10, 1, -4.371139e-07)
mesh = SubResource("BoxMesh_gvmkm")
surface_material_override/0 = SubResource("StandardMaterial3D_d2g23")
[node name="Mesh4" type="MeshInstance3D" parent="Mesh" unique_id=1513845959]
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -10, 1, 4.371139e-07)
mesh = SubResource("BoxMesh_gvmkm")
surface_material_override/0 = SubResource("StandardMaterial3D_d2g23")
[node name="StaticBody3D" type="StaticBody3D" parent="." unique_id=1165832201]
[node name="CollisionShape3D" type="CollisionShape3D" parent="StaticBody3D" unique_id=1944726310]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 22.141476, 0)
shape = SubResource("BoxShape3D_brfkd")

View File

@ -2,16 +2,11 @@ extends Node
var parent: CharacterBody3D
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
assert(get_parent().name == "Player", "Upgrade must have player as parent")
parent = get_parent()
## Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta: float) -> void:
#pass
func update() -> void:
var upgrades: Array = get_children()
@ -19,7 +14,6 @@ func update() -> void:
for upgrade in upgrades:
upgrade.update()
func reset():
var upgrades: Array = get_children()
print("Updating all upgrades...")