godot-2d-movement
Skill9 starsChanged 3 months agoMITView on GitHub
实现 Godot 4.7 的 CharacterBody2D 移动:速度、重力、跳跃、斜坡、coyote time 与输入反馈。制作 2D 玩家控制时使用。
1 other project uses a version of this.
Adopted by
Most recently taken up by
- gamedev-skills/awesome-gamedev-agent-skillstheir own version, first seen Nov 11, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- gamedev-skills/awesome-gamedev-agent-skills★ 9ksame name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository15 other files it gives its agents.
- godot-3d-essentialsSkill
- godot-ai-orchestrationSkill
- godot-animationSkill
- godot-audioSkill
- godot-csharpSkill
- godot-exportSkill
- godot-gdscriptSkill
- godot-multiplayerSkill
- godot-nodes-scenesSkill
- godot-physicsSkill
- godot-resourcesSkill
- godot-shadersSkill
- godot-signals-groupsSkill
- godot-tilemapSkill
- godot-ui-controlSkill
The file
Files
2D 移动
- 使用
CharacterBody2D.velocity与_physics_process,每物理帧只调用一次move_and_slide()。 - 输入来自 InputMap action,不硬编码设备键。用
Input.get_axis获取水平轴,并为手柄保留 deadzone。 - 地面状态基于
is_on_floor();重力只在离地时累计。跳跃、coyote time、jump buffer 和可变跳高分别建模,不混成一个计时器。 - 像素风项目考虑整数缩放、相机平滑与物理位置/渲染位置分离,避免抖动。
- 手感参数用 typed
@export暴露:速度、加速度、减速度、跳跃速度和容错窗口。
先用 input_map_manage 确保 action 与 bindings 幂等存在,再创建/修改脚本。运行后用 game_manage(op="input_sequence") 进行按帧移动和跳跃,回读玩家位置、速度和落地状态;被自动化测试覆盖的 restart / interact 等边缘动作不要只依赖 _unhandled_input(event) 或同帧 is_action_just_pressed,因为 action 状态注入不等价于 InputEvent,优先轮询 pressed 状态并自行做上一帧边缘检测。Camera2D 在 Godot 4 使用 enabled,不猜测旧版 current 属性;最后截图检查运动、完整关卡边界与相机 zoom。
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

