Hide the debug fly and level skip behind a 房★主★有★神★器★ easter-egg panel

cheat_panel replaces the level_skip autoload: a single small button in the top-right opens a panel holding the fly toggle and the level jump buttons, so nothing that looks like leftover debug UI is on screen. The fly is no longer gated behind OS.is_debug_build, so the easter egg works in exported builds too, and the 1/2/3 shortcuts only fire while the panel is open so they cannot be hit by accident. Space stays unbound and no gameplay content was touched.
This commit is contained in:
2026-10-07 23:10:41 +08:00
parent 44e4c3a751
commit f549c03533
8 changed files with 208 additions and 100 deletions
+10 -5
View File
@@ -18,12 +18,12 @@
| 按键 | 作用 |
|---|---|
| `A` / `D` | 左右移动 |
| `空格` | 跳跃(单段,空中不能二段跳) |
| `空格` | (当前已停用,输入映射里的 `jump` 键位为空) |
| `S` 按住 | 显示投掷抛物线预览 |
| `S` 松开 | 投出钥匙 |
| `W` | 传送到扔出去的钥匙位置,并把它捡回来 |
| `Z` | 消耗一个回血道具:回一颗心 + 5 秒无敌盾 |
| `F` | 切换飞行(**仅编辑器 / 调试版可用**,见下方说明) |
| `F` | 切换飞行(**隐藏技能**,藏在右上角「房★主★有★神★器★」面板里,见下方说明) |
| `R` / `Enter` | 死亡后重新开始 |
---
@@ -49,6 +49,9 @@
- **重力**:`get_gravity()`,只在 `not is_on_floor()` 时累加到 `velocity.y`
- **水平移动**:`Input.get_axis("move_left", "move_right")` 取方向,用 `move_toward()` 做加速 / 减速插值,手感比直接赋值柔和
- **跳跃**:`Input.is_action_just_pressed("jump")` 配合 `is_on_floor()`,因此**只有踩在地面上才能起跳**,天然不会二段跳
- ⚠️ 目前输入映射里的 `jump` **没有绑定任何按键**(空格被空置了),所以这段代码暂时不会触发。
想恢复:`项目 → 项目设置 → 输入映射 → jump → 添加按键 → 空格`,或者把 `project.godot` 里
`jump` 的 `"events"` 改回 `[Object(InputEventKey, ... "physical_keycode":32 ...)]`。
- **朝向**:根据 `velocity.x` 的正负翻转 `Sprite2D.flip_h`
### ② 瓦片地图
@@ -92,10 +95,12 @@
- 按 `W`:瞬移到钥匙所在位置并收回它
- 因为预测和实际飞行调用的是**同一个 `simulate_trajectory()` 函数**,"弧线显示能落到的地方"就等于"钥匙真正落到的地方"(实测偏差 0.000 px)
**技能 B —— 飞行**(`player_controller.gd`)
**技能 B —— 飞行(隐藏技能)**(`player_controller.gd`)
- 按 `F` 切换飞行状态,`W` / `S` 控制升降,`A` / `D` 平移
- 为了不影响正式玩法的难度平衡,**只在编辑器 / 调试版生效**(`OS.is_debug_build()`),导出正式版按键无效
- 按 `F` 切换飞行状态,方向键 ↑ / ↓ 控制升降(`S` 也可以下降),`A` / `D` 平移
- 屏幕上不会有任何提示,它是藏在右上角 **「房★主★有★神★器★」** 按钮里的彩蛋:
点开面板就能看到飞行开关和跳关按钮(键盘 `1` / `2` / `3` 跳关,`Esc` 关闭面板)
- 这个面板由自动加载单例 `scripts/cheat_panel.gd` 提供,**三个关卡都有,正式版里也能用**
- 如果想在导出版里也开放,把 `fly_available()` 里的 `OS.is_debug_build()` 去掉即可:
```gdscript
func fly_available() -> bool: