Split game module documentation
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
# Input
|
||||
|
||||
## 职责
|
||||
|
||||
输入模块负责把 PC、SDL 手柄和 Switch 输入统一成游戏语义。
|
||||
|
||||
主要源码:
|
||||
|
||||
- `game/src/core/input_state.*`
|
||||
- `game/docs/controls.md`
|
||||
|
||||
## 当前语义
|
||||
|
||||
`InputState` 只暴露游戏需要的动作:
|
||||
|
||||
- `moveX`:水平输入,范围 `-1.0` 到 `1.0`。
|
||||
- `jumpPressed`:跳跃按下瞬间。
|
||||
- `attackPressed`:攻击按下瞬间。
|
||||
|
||||
## 当前映射
|
||||
|
||||
详细按键见 `../controls.md`。
|
||||
|
||||
原则:
|
||||
|
||||
- 角色逻辑只消费 `InputState`。
|
||||
- PC/Switch 差异只存在于 `InputStateProvider`。
|
||||
- 跳跃和攻击使用“按下瞬间”,避免长按每帧触发。
|
||||
|
||||
## 下一步
|
||||
|
||||
- 增加 `InputConfig`,并通过 `Asset` 或 PVF 读取。
|
||||
- 分离 gameplay 输入和 debug 输入。
|
||||
- 增加输入状态 debug 显示。
|
||||
Reference in New Issue
Block a user