Files
Yanchen bf6c355fa6 feat: 切换至滚动阻力运行模型并更新资产、编辑器与验证
- 物理规则:现行模型仅保留滚动阻力耗能与恢复系数碰撞,风力、空气阻力、静摩擦、动摩擦不再参与运行;确认三球质量 60/330/约890 kg 及水密度、流阻参数
- 定向加速改为真实顶面接触触发的一次性 +5 m/s 速度事件,模型新增渐进式 U 形导槽出口
- 更新球体、滑槽、水/冰/墙、球洞模型与 storybook 目录、物理、实体配置
- 工坊摆放、编辑器、运行适配与检查脚本同步;删除过时的 baseline 三组检查
- 新增谜题设计参考文档、关卡草稿与本轮实验产物
2026-12-05 10:37:31 +08:00

20 lines
948 B
GDScript

extends RefCounted
static func read_lesson(index: int) -> Dictionary:
return JSON.parse_string(FileAccess.get_file_as_string("res://playtest/tutorial/data/%02d.json" % (index+1)))
static func initial_level(lesson: Dictionary, lib) -> Dictionary:
var data: Dictionary = lesson.initial.duplicate(true)
var launcher:Dictionary={}
for entity in data.entities:
if entity.id==lesson.spawn.entityId:launcher=entity;break
assert(not launcher.is_empty(),"Missing launch block")
var basis:=Basis(Vector3.UP,-int(launcher.quarter)*PI/2)
var top:float=lib.catalog[launcher.kind].baseHeight
var pos:Vector3=lib.vector(launcher.position)+basis*Vector3(float(lesson.spawn.get("localX",0)),top+lib.ball_radius()+.02,0)
data.balls = [{"id":"student_ball","ballTypeId":"iron_ball","position":[pos.x,pos.y,pos.z]}]
return data
static func solution(lesson: Dictionary) -> Array:
return JSON.parse_string(FileAccess.get_file_as_string(lesson.solution))