refactor: organise assets, tidy player.gd, unbreak fresh import

Assets grouped by role, within the constraint that FBX materials resolve
their textures by path relative to the FBX itself (verified by forcing a
reimport and reading back the albedo paths):

  assets/level/   scene.fbx + Level1_v1.fbx + the platform maps they look
                  up as siblings
  assets/logos/   the three attribution logos
  assets/         chara_red.fbx, background.fbx — these reach up into
                  ../sourceimages and so cannot move
  sourcefiles/    scene.blend, behind a .gdignore

The .blend move is a bug fix, not tidying. Godot hands every importable
.blend to a headless Blender, and that call never returns on this project
— a fresh clone stalls on first import, and the machine still had orphaned
Blender processes from an earlier attempt. Nothing loads the .blend: the
level geometry is baked into level_1.tscn.

player.gd: spell out ct/bt/d/ix/a, type the physics step, group the
members, and point the blue skin at sourceimages/low_blue_mat_* — the same
files assets/Chara_blue/ was a byte-identical copy of.

Co-Authored-By: Claude Opus 5 <[email protected]>
This commit is contained in:
ASOwnerYT
2026-07-28 13:29:42 +12:00
co-authored by Claude Opus 5
parent 756d404d7f
commit f5a17e2c22
42 changed files with 137 additions and 101 deletions
+6
View File
@@ -24,5 +24,11 @@ Exports/
.idea/ .idea/
.DS_Store .DS_Store
# DCC scratch output. Maya writes .tx render caches and swatch thumbnails next
# to the textures it exports; Godot cannot read either of them.
*.tx
.mayaSwatches/
*.blend1
# Plugin specific # Plugin specific
addons/script-ide/* addons/script-ide/*
+3 -3
View File
@@ -20,19 +20,19 @@ License: [CC BY 4.0 International](https://github.com/godotengine/godot/blob/mas
## Tools ## Tools
#### Godot #### Godot
![Godot Engine Logo](/assets/godot_engine_logo/logo_vertical_color_dark.png) ![Godot Engine Logo](/assets/logos/godot_engine_logo/logo_vertical_color_dark.png)
Author: [Juan Linietsky, Ariel Manzur, and contributors](https://godotengine.org/contact) Author: [Juan Linietsky, Ariel Manzur, and contributors](https://godotengine.org/contact)
Source: [godotengine.org](https://godotengine.org/) Source: [godotengine.org](https://godotengine.org/)
License: [MIT License](https://github.com/godotengine/godot/blob/master/LICENSE.txt) License: [MIT License](https://github.com/godotengine/godot/blob/master/LICENSE.txt)
#### Godot Game Template #### Godot Game Template
![Maaack Plugin Icon](/assets/plugin_logo/logo.png) ![Maaack Plugin Icon](/assets/logos/plugin_logo/logo.png)
Author: [Marek Belski and contributors](https://github.com/Maaack/Godot-Game-Template/graphs/contributors) Author: [Marek Belski and contributors](https://github.com/Maaack/Godot-Game-Template/graphs/contributors)
Source: [github: Godot-Game-Template](https://github.com/Maaack/Godot-Game-Template) Source: [github: Godot-Game-Template](https://github.com/Maaack/Godot-Game-Template)
License: [MIT License](LICENSE.txt) License: [MIT License](LICENSE.txt)
#### Git #### Git
![Git Logo](/assets/git_logo/Git-Logo-2Color.png) ![Git Logo](/assets/logos/git_logo/Git-Logo-2Color.png)
Author: [Linus Torvalds](https://github.com/torvalds) Author: [Linus Torvalds](https://github.com/torvalds)
Source: [git-scm.com](https://git-scm.com/downloads) Source: [git-scm.com](https://git-scm.com/downloads)
License: [GNU General Public License version 2](https://opensource.org/licenses/GPL-2.0) License: [GNU General Public License version 2](https://opensource.org/licenses/GPL-2.0)
@@ -4,12 +4,12 @@ importer="scene"
importer_version=1 importer_version=1
type="PackedScene" type="PackedScene"
uid="uid://cvu5f82j7vxdl" uid="uid://cvu5f82j7vxdl"
path="res://.godot/imported/Level1_v1.fbx-6541db1786b04595d703452dfc5c0724.scn" path="res://.godot/imported/Level1_v1.fbx-057b7bbcfd96046aa01265df55d6c0f0.scn"
[deps] [deps]
source_file="res://assets/Level1_v1.fbx" source_file="res://assets/level/Level1_v1.fbx"
dest_files=["res://.godot/imported/Level1_v1.fbx-6541db1786b04595d703452dfc5c0724.scn"] dest_files=["res://.godot/imported/Level1_v1.fbx-057b7bbcfd96046aa01265df55d6c0f0.scn"]
[params] [params]
@@ -3,8 +3,8 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://bo0602fd212nj" uid="uid://bo0602fd212nj"
path.s3tc="res://.godot/imported/platforms_standardSurface1_BaseColor_Utility - sRGB - Texture.1001.png-4f06041a35059be2b8817e3299e66844.s3tc.ctex" path.s3tc="res://.godot/imported/platforms_standardSurface1_BaseColor_Utility - sRGB - Texture.1001.png-ad8b8e29a824591a12240216aa85250b.s3tc.ctex"
path.etc2="res://.godot/imported/platforms_standardSurface1_BaseColor_Utility - sRGB - Texture.1001.png-4f06041a35059be2b8817e3299e66844.etc2.ctex" path.etc2="res://.godot/imported/platforms_standardSurface1_BaseColor_Utility - sRGB - Texture.1001.png-ad8b8e29a824591a12240216aa85250b.etc2.ctex"
metadata={ metadata={
"imported_formats": ["s3tc_bptc", "etc2_astc"], "imported_formats": ["s3tc_bptc", "etc2_astc"],
"vram_texture": true "vram_texture": true
@@ -12,8 +12,8 @@ metadata={
[deps] [deps]
source_file="res://assets/platforms_standardSurface1_BaseColor_Utility - sRGB - Texture.1001.png" source_file="res://assets/level/platforms_standardSurface1_BaseColor_Utility - sRGB - Texture.1001.png"
dest_files=["res://.godot/imported/platforms_standardSurface1_BaseColor_Utility - sRGB - Texture.1001.png-4f06041a35059be2b8817e3299e66844.s3tc.ctex", "res://.godot/imported/platforms_standardSurface1_BaseColor_Utility - sRGB - Texture.1001.png-4f06041a35059be2b8817e3299e66844.etc2.ctex"] dest_files=["res://.godot/imported/platforms_standardSurface1_BaseColor_Utility - sRGB - Texture.1001.png-ad8b8e29a824591a12240216aa85250b.s3tc.ctex", "res://.godot/imported/platforms_standardSurface1_BaseColor_Utility - sRGB - Texture.1001.png-ad8b8e29a824591a12240216aa85250b.etc2.ctex"]
[params] [params]

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

@@ -3,15 +3,15 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://ok4qnq61otv6" uid="uid://ok4qnq61otv6"
path="res://.godot/imported/platforms_standardSurface1_Height_Utility - Raw.1001.png-9fa1ee72a753b5093652196104ffa8a0.ctex" path="res://.godot/imported/platforms_standardSurface1_Height_Utility - Raw.1001.png-777b30503394249f52f49e41ba5bf8ae.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
} }
[deps] [deps]
source_file="res://assets/platforms_standardSurface1_Height_Utility - Raw.1001.png" source_file="res://assets/level/platforms_standardSurface1_Height_Utility - Raw.1001.png"
dest_files=["res://.godot/imported/platforms_standardSurface1_Height_Utility - Raw.1001.png-9fa1ee72a753b5093652196104ffa8a0.ctex"] dest_files=["res://.godot/imported/platforms_standardSurface1_Height_Utility - Raw.1001.png-777b30503394249f52f49e41ba5bf8ae.ctex"]
[params] [params]

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

@@ -3,15 +3,15 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://crj7sefmt2awi" uid="uid://crj7sefmt2awi"
path="res://.godot/imported/platforms_standardSurface1_Metallic_Utility - Raw.1001.png-361032c1ea5c62df0c32fada5d890a9d.ctex" path="res://.godot/imported/platforms_standardSurface1_Metallic_Utility - Raw.1001.png-b81b84c1a5c3dcf3075d1db6d41ccf71.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
} }
[deps] [deps]
source_file="res://assets/platforms_standardSurface1_Metallic_Utility - Raw.1001.png" source_file="res://assets/level/platforms_standardSurface1_Metallic_Utility - Raw.1001.png"
dest_files=["res://.godot/imported/platforms_standardSurface1_Metallic_Utility - Raw.1001.png-361032c1ea5c62df0c32fada5d890a9d.ctex"] dest_files=["res://.godot/imported/platforms_standardSurface1_Metallic_Utility - Raw.1001.png-b81b84c1a5c3dcf3075d1db6d41ccf71.ctex"]
[params] [params]

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 57 KiB

@@ -3,15 +3,15 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://c1bf2s6x0nxsc" uid="uid://c1bf2s6x0nxsc"
path="res://.godot/imported/platforms_standardSurface1_Normal_Utility - Raw.1001.png-fd10bfb3d7541cec009f898086da7e37.ctex" path="res://.godot/imported/platforms_standardSurface1_Normal_Utility - Raw.1001.png-e6101e66d16870d4a647bc2c3c5fb4a4.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
} }
[deps] [deps]
source_file="res://assets/platforms_standardSurface1_Normal_Utility - Raw.1001.png" source_file="res://assets/level/platforms_standardSurface1_Normal_Utility - Raw.1001.png"
dest_files=["res://.godot/imported/platforms_standardSurface1_Normal_Utility - Raw.1001.png-fd10bfb3d7541cec009f898086da7e37.ctex"] dest_files=["res://.godot/imported/platforms_standardSurface1_Normal_Utility - Raw.1001.png-e6101e66d16870d4a647bc2c3c5fb4a4.ctex"]
[params] [params]

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

@@ -3,15 +3,15 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://byhrhfh6djv4n" uid="uid://byhrhfh6djv4n"
path="res://.godot/imported/platforms_standardSurface1_Roughness_Utility - Raw.1001.png-fe111d4d6b6d19e04a4926943106ed30.ctex" path="res://.godot/imported/platforms_standardSurface1_Roughness_Utility - Raw.1001.png-f5b24f62e5750889bc87da5d3091c4ed.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
} }
[deps] [deps]
source_file="res://assets/platforms_standardSurface1_Roughness_Utility - Raw.1001.png" source_file="res://assets/level/platforms_standardSurface1_Roughness_Utility - Raw.1001.png"
dest_files=["res://.godot/imported/platforms_standardSurface1_Roughness_Utility - Raw.1001.png-fe111d4d6b6d19e04a4926943106ed30.ctex"] dest_files=["res://.godot/imported/platforms_standardSurface1_Roughness_Utility - Raw.1001.png-f5b24f62e5750889bc87da5d3091c4ed.ctex"]
[params] [params]
@@ -3,15 +3,15 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://clmvuvi0y4t4w" uid="uid://clmvuvi0y4t4w"
path="res://.godot/imported/platforms_standardSurface3_BaseColor_Utility - sRGB - Texture.1001.png-b6bd7f5fb16a853ec1691698f415fa3a.ctex" path="res://.godot/imported/platforms_standardSurface3_BaseColor_Utility - sRGB - Texture.1001.png-70449054549b50b9927be5743373522e.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
} }
[deps] [deps]
source_file="res://assets/platforms_standardSurface3_BaseColor_Utility - sRGB - Texture.1001.png" source_file="res://assets/level/platforms_standardSurface3_BaseColor_Utility - sRGB - Texture.1001.png"
dest_files=["res://.godot/imported/platforms_standardSurface3_BaseColor_Utility - sRGB - Texture.1001.png-b6bd7f5fb16a853ec1691698f415fa3a.ctex"] dest_files=["res://.godot/imported/platforms_standardSurface3_BaseColor_Utility - sRGB - Texture.1001.png-70449054549b50b9927be5743373522e.ctex"]
[params] [params]

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

@@ -3,15 +3,15 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://dwfpnjyx05fp6" uid="uid://dwfpnjyx05fp6"
path="res://.godot/imported/platforms_standardSurface3_Height_Utility - Raw.1001.png-3ccce37bd2e75802e7fdf7aed9107db5.ctex" path="res://.godot/imported/platforms_standardSurface3_Height_Utility - Raw.1001.png-2fa47e5532f267e08a1945b38ff2340a.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
} }
[deps] [deps]
source_file="res://assets/platforms_standardSurface3_Height_Utility - Raw.1001.png" source_file="res://assets/level/platforms_standardSurface3_Height_Utility - Raw.1001.png"
dest_files=["res://.godot/imported/platforms_standardSurface3_Height_Utility - Raw.1001.png-3ccce37bd2e75802e7fdf7aed9107db5.ctex"] dest_files=["res://.godot/imported/platforms_standardSurface3_Height_Utility - Raw.1001.png-2fa47e5532f267e08a1945b38ff2340a.ctex"]
[params] [params]

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

@@ -3,15 +3,15 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://deegjbiilo4qh" uid="uid://deegjbiilo4qh"
path="res://.godot/imported/platforms_standardSurface3_Metallic_Utility - Raw.1001.png-e8567edce7b779df19a94bf13a3c2c6b.ctex" path="res://.godot/imported/platforms_standardSurface3_Metallic_Utility - Raw.1001.png-8ae6b39f540d1f7687eb0502425b6574.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
} }
[deps] [deps]
source_file="res://assets/platforms_standardSurface3_Metallic_Utility - Raw.1001.png" source_file="res://assets/level/platforms_standardSurface3_Metallic_Utility - Raw.1001.png"
dest_files=["res://.godot/imported/platforms_standardSurface3_Metallic_Utility - Raw.1001.png-e8567edce7b779df19a94bf13a3c2c6b.ctex"] dest_files=["res://.godot/imported/platforms_standardSurface3_Metallic_Utility - Raw.1001.png-8ae6b39f540d1f7687eb0502425b6574.ctex"]
[params] [params]

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 57 KiB

@@ -3,15 +3,15 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://b3f4nljeeaxuf" uid="uid://b3f4nljeeaxuf"
path="res://.godot/imported/platforms_standardSurface3_Normal_Utility - Raw.1001.png-9899da9b90606170ef2c6f632d4bda09.ctex" path="res://.godot/imported/platforms_standardSurface3_Normal_Utility - Raw.1001.png-8952996cb064639fe8fa29b4f8450a94.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
} }
[deps] [deps]
source_file="res://assets/platforms_standardSurface3_Normal_Utility - Raw.1001.png" source_file="res://assets/level/platforms_standardSurface3_Normal_Utility - Raw.1001.png"
dest_files=["res://.godot/imported/platforms_standardSurface3_Normal_Utility - Raw.1001.png-9899da9b90606170ef2c6f632d4bda09.ctex"] dest_files=["res://.godot/imported/platforms_standardSurface3_Normal_Utility - Raw.1001.png-8952996cb064639fe8fa29b4f8450a94.ctex"]
[params] [params]

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

@@ -3,15 +3,15 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://o5ku8w30ow3n" uid="uid://o5ku8w30ow3n"
path="res://.godot/imported/platforms_standardSurface3_Roughness_Utility - Raw.1001.png-66106a2600a9946699e0f2afb68cb5a3.ctex" path="res://.godot/imported/platforms_standardSurface3_Roughness_Utility - Raw.1001.png-77c7c4d5028b159fed9adbb7040090fc.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
} }
[deps] [deps]
source_file="res://assets/platforms_standardSurface3_Roughness_Utility - Raw.1001.png" source_file="res://assets/level/platforms_standardSurface3_Roughness_Utility - Raw.1001.png"
dest_files=["res://.godot/imported/platforms_standardSurface3_Roughness_Utility - Raw.1001.png-66106a2600a9946699e0f2afb68cb5a3.ctex"] dest_files=["res://.godot/imported/platforms_standardSurface3_Roughness_Utility - Raw.1001.png-77c7c4d5028b159fed9adbb7040090fc.ctex"]
[params] [params]
@@ -4,12 +4,12 @@ importer="scene"
importer_version=1 importer_version=1
type="PackedScene" type="PackedScene"
uid="uid://d4nq16vll1epw" uid="uid://d4nq16vll1epw"
path="res://.godot/imported/scene.fbx-2308f6b2f104a5f17189746d74599a37.scn" path="res://.godot/imported/scene.fbx-bfc065eeab6a4eafe3b83ff308ad422d.scn"
[deps] [deps]
source_file="res://assets/scene.fbx" source_file="res://assets/level/scene.fbx"
dest_files=["res://.godot/imported/scene.fbx-2308f6b2f104a5f17189746d74599a37.scn"] dest_files=["res://.godot/imported/scene.fbx-bfc065eeab6a4eafe3b83ff308ad422d.scn"]
[params] [params]

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

@@ -3,15 +3,15 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://bxp0lwwu2vfar" uid="uid://bxp0lwwu2vfar"
path="res://.godot/imported/Git-Logo-2Color.png-73dc9fbbc7cfea42d3822db2a14ed5bd.ctex" path="res://.godot/imported/Git-Logo-2Color.png-9dbf03328931c338ba18c81c7021d96c.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
} }
[deps] [deps]
source_file="res://assets/git_logo/Git-Logo-2Color.png" source_file="res://assets/logos/git_logo/Git-Logo-2Color.png"
dest_files=["res://.godot/imported/Git-Logo-2Color.png-73dc9fbbc7cfea42d3822db2a14ed5bd.ctex"] dest_files=["res://.godot/imported/Git-Logo-2Color.png-9dbf03328931c338ba18c81c7021d96c.ctex"]
[params] [params]

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 45 KiB

@@ -3,15 +3,15 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://daput5j66exgu" uid="uid://daput5j66exgu"
path="res://.godot/imported/logo_vertical_color_dark.png-056a6f9bbcf3b5b4e6d6f8f5f4aa19c6.ctex" path="res://.godot/imported/logo_vertical_color_dark.png-b311ca50a9d36498c78874961d6e6bd9.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
} }
[deps] [deps]
source_file="res://assets/godot_engine_logo/logo_vertical_color_dark.png" source_file="res://assets/logos/godot_engine_logo/logo_vertical_color_dark.png"
dest_files=["res://.godot/imported/logo_vertical_color_dark.png-056a6f9bbcf3b5b4e6d6f8f5f4aa19c6.ctex"] dest_files=["res://.godot/imported/logo_vertical_color_dark.png-b311ca50a9d36498c78874961d6e6bd9.ctex"]
[params] [params]

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

@@ -3,15 +3,15 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://cf77mc07j26a4" uid="uid://cf77mc07j26a4"
path="res://.godot/imported/logo.png-31474a8ee58537d771c887e29197a8a3.ctex" path="res://.godot/imported/logo.png-20abfc3ced547ee1ae9130be19fbf910.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
} }
[deps] [deps]
source_file="res://assets/plugin_logo/logo.png" source_file="res://assets/logos/plugin_logo/logo.png"
dest_files=["res://.godot/imported/logo.png-31474a8ee58537d771c887e29197a8a3.ctex"] dest_files=["res://.godot/imported/logo.png-20abfc3ced547ee1ae9130be19fbf910.ctex"]
[params] [params]
+3 -3
View File
@@ -5,9 +5,9 @@
[ext_resource type="PackedScene" uid="uid://cbual4qbgv2fc" path="res://scenes/player.tscn" id="2_623lg"] [ext_resource type="PackedScene" uid="uid://cbual4qbgv2fc" path="res://scenes/player.tscn" id="2_623lg"]
[ext_resource type="PackedScene" uid="uid://x4xnc85khpl5" path="res://scenes/path_3d_rope.tscn" id="3_sycfm"] [ext_resource type="PackedScene" uid="uid://x4xnc85khpl5" path="res://scenes/path_3d_rope.tscn" id="3_sycfm"]
[ext_resource type="PackedScene" uid="uid://b33nsypu7y3l6" path="res://assets/background.fbx" id="5_sycfm"] [ext_resource type="PackedScene" uid="uid://b33nsypu7y3l6" path="res://assets/background.fbx" id="5_sycfm"]
[ext_resource type="Texture2D" uid="uid://bo0602fd212nj" path="res://assets/platforms_standardSurface1_BaseColor_Utility - sRGB - Texture.1001.png" id="6_sycfm"] [ext_resource type="Texture2D" uid="uid://bo0602fd212nj" path="res://assets/level/platforms_standardSurface1_BaseColor_Utility - sRGB - Texture.1001.png" id="6_sycfm"]
[sub_resource type="Curve3D" id="Curve3D_w6i3l"] [sub_resource type="Curve3D" id="Curve3D_sycfm"]
resource_local_to_scene = true resource_local_to_scene = true
bake_interval = 512.0 bake_interval = 512.0
_data = { _data = {
@@ -971,7 +971,7 @@ gravity_vector = Vector3(0, -20, 0)
jump_speed = 13.0 jump_speed = 13.0
[node name="Path3DRope" parent="." unique_id=301387047 instance=ExtResource("3_sycfm")] [node name="Path3DRope" parent="." unique_id=301387047 instance=ExtResource("3_sycfm")]
curve = SubResource("Curve3D_w6i3l") curve = SubResource("Curve3D_sycfm")
attach_start_path = NodePath("../Player1") attach_start_path = NodePath("../Player1")
attach_end_path = NodePath("../Player2") attach_end_path = NodePath("../Player2")
max_length = 6.0 max_length = 6.0
+1 -1
View File
@@ -1,7 +1,7 @@
[gd_scene format=3 uid="uid://bk80fxrac0p3i"] [gd_scene format=3 uid="uid://bk80fxrac0p3i"]
[ext_resource type="PackedScene" path="res://addons/maaacks_game_template/base/nodes/opening/opening.tscn" id="1_ke3tw"] [ext_resource type="PackedScene" path="res://addons/maaacks_game_template/base/nodes/opening/opening.tscn" id="1_ke3tw"]
[ext_resource type="Texture2D" path="res://assets/godot_engine_logo/logo_vertical_color_dark.png" id="2_ke3tw"] [ext_resource type="Texture2D" path="res://assets/logos/godot_engine_logo/logo_vertical_color_dark.png" id="2_ke3tw"]
[node name="Opening" unique_id=1930105641 instance=ExtResource("1_ke3tw")] [node name="Opening" unique_id=1930105641 instance=ExtResource("1_ke3tw")]
images = Array[Texture2D]([ExtResource("2_ke3tw")]) images = Array[Texture2D]([ExtResource("2_ke3tw")])
+64 -44
View File
@@ -1,6 +1,22 @@
class_name Player class_name Player
extends CharacterBody3D extends CharacterBody3D
## Player-vs-player stacking. A rider standing on us would otherwise block our
## own move_and_slide (its collider reads as a slanted wall), so while carried we
## drop the players layer from our mask — the rider keeps colliding with us, the
## test is one-way. Carrying the rider along is CharacterBody3D's own
## moving-platform handling; adding it again here just launches them off.
const PLAYERS_LAYER := 2
const CARRIED_LINGER := 0.1
## The character model ships textured in red. Player 1 wears the blue variant,
## which exists only as a pair of base-color maps sitting beside the red ones
## under the same name — every other map (normal/roughness/metallic/height) is
## shared between the two, so albedo is all that gets swapped.
const BLUE_SKIN_PLAYER_ID := 1
const RED_MATERIAL_PREFIX := "low_chara_mat_"
const BLUE_MATERIAL_PREFIX := "low_blue_mat_"
@export var player_id := 1 @export var player_id := 1
@export var gravity_vector := Vector3(0, -15, 0) @export var gravity_vector := Vector3(0, -15, 0)
@export var move_speed := 8.0 @export var move_speed := 8.0
@@ -11,16 +27,11 @@ extends CharacterBody3D
@export var coyote := 0.1 @export var coyote := 0.1
@export var buffer := 0.1 @export var buffer := 0.1
var ct := 0.0 # Coyote time and jump buffer remaining, in seconds.
var bt := 0.0 var coyote_t := 0.0
var buffer_t := 0.0
## Player-vs-player stacking. A rider standing on us would otherwise block our # Time left on the one-way stacking exemption. See PLAYERS_LAYER.
## own move_and_slide (its collider reads as a slanted wall), so while carried we
## drop the players layer from our mask — the rider keeps colliding with us, the
## test is one-way. Carrying the rider along is CharacterBody3D's own
## moving-platform handling; adding it again here just launches them off.
const PLAYERS_LAYER := 2
const CARRIED_LINGER := 0.1
var carried_t := 0.0 var carried_t := 0.0
## Cleared when the run ends. Physics keeps running — the player still falls, ## Cleared when the run ends. Physics keeps running — the player still falls,
@@ -28,72 +39,81 @@ var carried_t := 0.0
## input is ignored. ## input is ignored.
var controls_enabled := true : set = set_controls_enabled var controls_enabled := true : set = set_controls_enabled
const BLUE_TEXTURE_DIR := "res://assets/Chara_blue/"
# Drops the buffered jump on the way out, so a press from the frame before the # Drops the buffered jump on the way out, so a press from the frame before the
# controls were cut does not still fire afterwards. # controls were cut does not still fire afterwards.
func set_controls_enabled(value : bool) -> void: func set_controls_enabled(value : bool) -> void:
controls_enabled = value controls_enabled = value
if not value: if not value:
bt = 0.0 buffer_t = 0.0
func _ready():
func _ready() -> void:
add_to_group("players") add_to_group("players")
if player_id == 1: if player_id == BLUE_SKIN_PLAYER_ID:
_apply_blue_skin(self) _apply_blue_skin(self)
# The character mesh ships with the red base-color maps baked into its
# materials. Player 1 reuses the same mesh with the blue maps swapped in: # Walks the model and re-points every surface that uses a red base-color map at
# every other map (normal/roughness/metallic/height) is shared between the # its blue counterpart. Surfaces without one (the visor, the hands the two
# two colour variants, so only albedo needs overriding. # variants share) keep the material they were imported with.
func _apply_blue_skin(node : Node) -> void: func _apply_blue_skin(node : Node) -> void:
for child in node.get_children(): for child in node.get_children():
_apply_blue_skin(child) _apply_blue_skin(child)
var mi := node as MeshInstance3D var mesh_instance := node as MeshInstance3D
if mi == null or mi.mesh == null: if mesh_instance == null or mesh_instance.mesh == null:
return return
for i in mi.mesh.get_surface_count(): for surface in mesh_instance.mesh.get_surface_count():
var mat := mi.get_active_material(i) as BaseMaterial3D var material := mesh_instance.get_active_material(surface) as BaseMaterial3D
if mat == null or mat.albedo_texture == null: if material == null or material.albedo_texture == null:
continue continue
var blue_path := BLUE_TEXTURE_DIR + mat.albedo_texture.resource_path.get_file() var blue_path := material.albedo_texture.resource_path.replace(
RED_MATERIAL_PREFIX, BLUE_MATERIAL_PREFIX
)
if not ResourceLoader.exists(blue_path): if not ResourceLoader.exists(blue_path):
continue continue
var blue_mat := mat.duplicate() as BaseMaterial3D var blue_material := material.duplicate() as BaseMaterial3D
blue_mat.albedo_texture = load(blue_path) blue_material.albedo_texture = load(blue_path)
mi.set_surface_override_material(i, blue_mat) mesh_instance.set_surface_override_material(surface, blue_material)
func _physics_process(d):
var up = Vector3.UP if gravity_vector.length_squared() < 0.0001 else -gravity_vector.normalized() func _physics_process(delta : float) -> void:
var up := Vector3.UP if gravity_vector.length_squared() < 0.0001 else -gravity_vector.normalized()
up_direction = up up_direction = up
velocity += gravity_vector * d velocity += gravity_vector * delta
ct = coyote if is_on_floor() else max(ct - d, 0.0)
bt = max(bt - d, 0.0) coyote_t = coyote if is_on_floor() else maxf(coyote_t - delta, 0.0)
buffer_t = maxf(buffer_t - delta, 0.0)
if controls_enabled and Input.is_action_just_pressed("p%d_jump" % player_id): if controls_enabled and Input.is_action_just_pressed("p%d_jump" % player_id):
bt = buffer buffer_t = buffer
var ix = Input.get_axis("p%d_left" % player_id, "p%d_right" % player_id) if controls_enabled else 0.0
var a = accel if is_on_floor() else accel * air_control var input_x := Input.get_axis("p%d_left" % player_id, "p%d_right" % player_id) if controls_enabled else 0.0
if abs(ix) > 0.01: var rate := accel if is_on_floor() else accel * air_control
velocity.x = move_toward(velocity.x, ix * move_speed, a * d) if absf(input_x) > 0.01:
velocity.x = move_toward(velocity.x, input_x * move_speed, rate * delta)
else: else:
velocity.x = move_toward(velocity.x, 0.0, friction * d) velocity.x = move_toward(velocity.x, 0.0, friction * delta)
if bt > 0.0 and ct > 0.0:
if buffer_t > 0.0 and coyote_t > 0.0:
velocity = velocity.slide(up) + up * jump_speed velocity = velocity.slide(up) + up * jump_speed
bt = 0.0 buffer_t = 0.0
ct = 0.0 coyote_t = 0.0
carried_t = max(carried_t - d, 0.0)
carried_t = maxf(carried_t - delta, 0.0)
set_collision_mask_value(PLAYERS_LAYER, carried_t <= 0.0) set_collision_mask_value(PLAYERS_LAYER, carried_t <= 0.0)
# plane lock: 2D platformer physics in a 3D scene. Sliding along an angled # plane lock: 2D platformer physics in a 3D scene. Sliding along an angled
# collision normal can otherwise walk the player off the Z=0 plane. # collision normal can otherwise walk the player off the Z=0 plane.
velocity.z = 0.0 velocity.z = 0.0
move_and_slide() move_and_slide()
# Riding is handled by CharacterBody3D's own moving-platform support, so the # Riding is handled by CharacterBody3D's own moving-platform support, so the
# only thing to do here is tell whoever we landed on that it is carrying us. # only thing to do here is tell whoever we landed on that it is carrying us.
for i in get_slide_collision_count(): for i in get_slide_collision_count():
var col := get_slide_collision(i) var collision := get_slide_collision(i)
if col.get_normal().dot(up) < 0.7: if collision.get_normal().dot(up) < 0.7:
continue continue
var below := col.get_collider() as Player var below := collision.get_collider() as Player
if below != null: if below != null:
below.carried_t = CARRIED_LINGER below.carried_t = CARRIED_LINGER
global_position.z = 0.0 global_position.z = 0.0
View File
+10
View File
@@ -0,0 +1,10 @@
# Source files
Editable art sources that the engine does not consume. `scene.blend` is the
Blender source for `assets/level/scene.fbx`; the level geometry the game
actually loads is baked into `scenes/game_scene/levels/level_1.tscn`.
The empty `.gdignore` here keeps Godot out of this directory. Left importable,
Godot hands every `.blend` to a headless Blender at import time, and that call
hangs indefinitely on this project — stalling the first import of a fresh
clone. Export to FBX in `assets/` instead of relying on `.blend` import.
@@ -4,12 +4,12 @@ importer="scene"
importer_version=1 importer_version=1
type="PackedScene" type="PackedScene"
uid="uid://valx6a5gep7b" uid="uid://valx6a5gep7b"
path="res://.godot/imported/scene.blend-a7ac89551fac062f7682e2b7d32e8c98.scn" path="res://.godot/imported/scene.blend-b11bd894821666c7e7b8236eab67765e.scn"
[deps] [deps]
source_file="res://assets/scene.blend" source_file="res://assets/level/scene.blend"
dest_files=["res://.godot/imported/scene.blend-a7ac89551fac062f7682e2b7d32e8c98.scn"] dest_files=["res://.godot/imported/scene.blend-b11bd894821666c7e7b8236eab67765e.scn"]
[params] [params]