feat: 建立关卡工坊并整理项目目录

- 加入 Godot 基础试玩、画风展示和通孔验证场景
- 支持自由放球、多层叠放、墙壁、锥口球洞及固定 +5 m/s 定向加速方块
- 保存 Blender 源资产、模型导出、资源制作脚本和关卡编辑存档逻辑
- 按七类目录归档工程,集中 zsh 启动入口并补充 AGENTS.md 文件索引
- 同步设计规则、依赖锁定、验证报告和目录迁移记录

验证:目录迁移后的资源导入与四个场景加载通过;本次提交前检查暂存内容,未重复运行整套物理测试。
This commit is contained in:
Yanchen
2026-11-16 11:12:21 +08:00
parent 151993e6df
commit 39ff1fd7b4
233 changed files with 147900 additions and 152 deletions
@@ -0,0 +1,46 @@
extends RefCounted
const KIND := "directional_boost"
const SPEED_GAIN := 5.0
# One latch per ball and block. A small separation margin tolerates contact jitter.
var active: Dictionary = {}
var events: Array = []
func integrate(state: PhysicsDirectBodyState3D, radius: float) -> void:
var touching: Dictionary = {}
for i in range(state.get_contact_count()):
var collider: Node = state.get_contact_collider_object(i)
if collider == null or collider.get_meta("piece_type", "") != KIND:continue
var block: Node = collider
while block != null and not block.has_meta("boost_bounds"):block = block.get_parent()
if block == null:continue
var contact: Vector3 = state.get_contact_collider_position(i)
var normal := (state.transform.origin - contact).normalized()
var local: Vector3 = block.to_local(contact)
var bounds: AABB = block.get_meta("boost_bounds")
if normal.y < .9 or absf(local.y - bounds.end.y) > .025:continue
touching[block.get_instance_id()] = block
for id in active.keys():
if touching.has(id):continue
var block = active[id]
if not is_instance_valid(block):active.erase(id);continue
var local: Vector3 = block.to_local(state.transform.origin)
var bounds: AABB = block.get_meta("boost_bounds")
if local.x < bounds.position.x-.025 or local.x > bounds.end.x+.025 or local.z < bounds.position.z-.025 or local.z > bounds.end.z+.025 or absf(local.y-bounds.end.y-radius) > .06:
active.erase(id)
# Stable order for the rare case of simultaneously touching two top faces.
var blocks: Array = touching.values()
blocks.sort_custom(func(a,b):return str(a.get_meta("record_id",a.name)) < str(b.get_meta("record_id",b.name)))
for block in blocks:
var id: int = block.get_instance_id()
if active.has(id):continue
active[id] = block
var before := state.linear_velocity
var direction: Vector3 = block.global_basis * Vector3(block.get_meta("boost_direction"))
direction.y = 0;direction = direction.normalized()
var speed := Vector2(before.x,before.z).length() + SPEED_GAIN
var after := direction * speed
after.y = before.y
state.linear_velocity = after
events.append({"blockId":str(block.get_meta("record_id",block.name)),"before":before,"after":after,"tick":Engine.get_physics_frames()})
@@ -0,0 +1 @@
uid://bkojodf5an6c
Binary file not shown.
@@ -0,0 +1,45 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://ctugu4qe5hoes"
path="res://.godot/imported/model.glb-3291d7d4697a980d05594124bc8e18d7.scn"
[deps]
source_file="res://assets/blocks/directional_boost/model.glb"
dest_files=["res://.godot/imported/model.glb-3291d7d4697a980d05594124bc8e18d7.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/root_script=null
mesh_library/use_node_names_as_mesh_names=false
array_mesh/deduplicate_surfaces=true
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
gltf/texture_map_mode=1
@@ -0,0 +1,8 @@
"""Rebuild only this resource using the shared collection authoring code."""
from pathlib import Path
import runpy
RESOURCE = Path(__file__).resolve().parent.parent.name
ROOT = Path(__file__).resolve().parents[4]
runpy.run_path(str(ROOT / 'assets/collections/storybook/source/build.py'),
init_globals={'ONLY_ASSET': RESOURCE}, run_name='__main__')
Binary file not shown.
Binary file not shown.
+45
View File
@@ -0,0 +1,45 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://dsvx7y6xfcrhn"
path="res://.godot/imported/model.glb-e70e20d2f6a47b149d655452336f7d1c.scn"
[deps]
source_file="res://assets/blocks/wall/model.glb"
dest_files=["res://.godot/imported/model.glb-e70e20d2f6a47b149d655452336f7d1c.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/root_script=null
mesh_library/use_node_names_as_mesh_names=false
array_mesh/deduplicate_surfaces=true
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
gltf/texture_map_mode=1
View File
+8
View File
@@ -0,0 +1,8 @@
"""Rebuild only this resource using the shared collection authoring code."""
from pathlib import Path
import runpy
RESOURCE = Path(__file__).resolve().parent.parent.name
ROOT = Path(__file__).resolve().parents[4]
runpy.run_path(str(ROOT / 'assets/collections/storybook/source/build.py'),
init_globals={'ONLY_ASSET': RESOURCE}, run_name='__main__')
Binary file not shown.