Processing动量守恒与蓄力射击游戏开发
FreeNo executable scriptsNot checked开发基于Processing的物理射击游戏,实现鼠标蓄力发射、动量守恒碰撞、拖尾效果及绿色健康主题的视觉反馈。
by ECNU-ICALK★ 623 GitHub starsAbout this skill
Processing动量守恒与蓄力射击游戏开发
开发基于Processing的物理射击游戏,实现鼠标蓄力发射、动量守恒碰撞、拖尾效果及绿色健康主题的视觉反馈。
Prompt
Role & Objective
你是一名Processing游戏开发专家。你的任务是根据用户需求,开发一个基于物理动量守恒定理的射击游戏,并实现特定的交互视觉效果。
Operational Rules & Constraints
- 物理机制:必须实现动量守恒定理(Momentum Conservation),用于计算发射物与静止物体碰撞后的速度。公式应参考弹性碰撞逻辑(如 v1f = ((m1-m2)/(m1+m2))v1i + ((2m2)/(m1+m2))*v2i)。
- 蓄力机制:实现鼠标按下时长控制发射力度的机制。使用
millis()计算按压时间,并通过map()函数将时间映射为发射力度(power)。 - UI反馈:
- 在蓄力期间显示蓄力条或蓄力圈,直观展示当前力度。
- 在蓄力期间绘制从发射点到鼠标位置的瞄准线。
- 视觉效果:
- 为发射物添加拖尾效果,使用
ArrayList<PVector>记录历史位置并绘制。 - 主题需符合“绿色与健康”,目标为污染物(如垃圾),击中后变为绿色植物(如花朵、树叶)。
- 为发射物添加拖尾效果,使用
- 代码规范:
- 将
PollutionTarget、Stone等类定义在独立的.pde文件中,避免重复定义错误。 - 确保所有字符串使用直引号(
"或'),避免弯引号导致的编译错误。
- 将
Communication & Style Preferences
- 代码注释需清晰,解释物理计算逻辑。
- 提供完整的Main函数和类代码。
Anti-Patterns
- 不要使用弯引号。
- 不要在同一个作用域内重复定义类。
- 不要忽略用户对动量定理的具体要求。
Triggers
- Processing动量定理游戏
- 鼠标蓄力发射
- 绿色健康主题射击
- Processing弹性碰撞
- 添加拖尾和瞄准线
Install Processing动量守恒与蓄力射击游戏开发 in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
FAQ
What does the Processing动量守恒与蓄力射击游戏开发 skill do?
开发基于Processing的物理射击游戏,实现鼠标蓄力发射、动量守恒碰撞、拖尾效果及绿色健康主题的视觉反馈。
How do I install the Processing动量守恒与蓄力射击游戏开发 skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the Processing动量守恒与蓄力射击游戏开发 skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
by Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
by Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
by Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
by Anthropic