← 返回全部案例

CASE STUDY

2026.10.30 · 个人项目 · AI 协作

整理于约 5 分钟

Godot 实验室:试玩能动,为什么还不能算学会了?

Godot 入门实验室的原稿已经有试玩、六个学习单元、节点检查器和复盘导出。我想把它放进 Lumi Lab,让读者先体验,再回到 Godot 编辑器搭建。

接入时,我负责确定学习路径、页面风格和完成标准,AI 编程工具提取正文、迁移脚本并做浏览器检查。页面运行的是 Canvas 教学模拟,没有加载 Godot 引擎。

原稿独立运行,不代表嵌进网站就能运行

迁移过程中出现过一个直接的脚本错误:替换字符串时,原脚本里的 $$ 变成了 $。页面结构能够生成,交互脚本却无法解析。真实浏览器验收发现了这处问题,修复后又增加原始脚本解析回归,避免只检查静态页面。

原稿还有自己的页头、主题开关和嵌入高度消息。接入后统一复用主站外壳和主题,将样式与查询限定在实验区域。学习进度继续使用原存储键,避免为了统一外观把已有记录丢掉。

方向键要先知道读者正在做什么

试玩需要方向键,长文章也需要方向键滚动。如果页面一直监听游戏输入,读者阅读课程时就可能同时移动角色。

修正后,只有画布获得焦点时才控制角色;切换视图清理按键,页面隐藏时暂停。手机视口提供触屏方向键,松开后停止移动。暂停或离开游戏视图后,也不继续刷新画布。

这些细节让“我正在阅读”和“我正在试玩”有了可区分的状态。验收也从页面是否打开,推进到收集星星、重复触发、重置以及切换视图后的行为。

勾完课程,只能说明自己勾完了

进度保存还要处理损坏或越界数据。完成索引需要去重和校验,不能把任意存储内容当成已完成课程;浏览器拒绝保存时,需要提示读者,并保留 Markdown 下载备份。

我也没有把勾选设计成自动颁发“掌握 Godot”的证明。课程完成与交付检查由学习者自标记,网页小游戏不能证明示例 GDScript 在编辑器里运行成功。

历史验收记录覆盖浏览器试玩、笔记恢复、下载、主题与窄屏,并记下了脚本错误的修复。本轮只核对这些记录和源码,没有重新运行 Godot 编辑器、导出游戏或测试教学效果。下一步应当让学习者在编辑器里完成同一个小项目,再记录卡住的位置。可以从Godot 入门实验室开始。

Godot Lab: a working playground still needs a learning boundary

The original Godot learning lab already contained a playground, six lessons, a node inspector, and Markdown notes. I wanted it inside Lumi Lab so readers could experiment before rebuilding the example in Godot.

I set the learning path, visual requirements, and completion criteria. AI coding tools extracted the content, adapted scripts, and checked the browser. The page runs a Canvas simulation, without the Godot engine.

Integration introduced its own failure

During script conversion, string replacement changed $$ into $. Static markup could still build, but the interaction script failed to parse. Browser verification caught it. The fix also added a parsing regression for the original script.

The standalone header, theme switch, and embedding messages also needed adaptation. The integrated page uses the site’s shell and theme, limits styles and queries to the experiment, and keeps the original progress keys.

Keyboard input needs a clear context

The game uses arrow keys; readers use them to scroll. Listening for game input throughout the page could move the character while someone read a lesson.

Controls now require focus on the canvas. Changing views clears held keys, hiding the page pauses the game, and inactive views stop refreshing the canvas. Mobile controls stop movement on release. Verification covered collecting stars, duplicate triggers, reset, and view changes.

A checked lesson is a self-report

Stored completion indexes need validation and deduplication. Rejected storage writes need a visible message and an export route. Neither arbitrary stored values nor a checked box can establish that someone learned the material.

The same boundary applies to the playground: browser interaction does not establish that the GDScript example works in the editor. Historical checks covered the simulation, restored notes, downloads, themes, and narrow layouts. I reviewed those records and the source for this article without rerunning the Godot editor, exporting a game, or measuring learning.

The next useful check is a learner rebuilding the project in the editor and recording where they get stuck. The Godot learning lab provides the starting exercise.