2D 格斗游戏的碰撞箱。工具?
我正在开发一款 2D 格斗游戏,其风格与 Capcom 的 iPhone 版街头霸王 Alpha 相同。对于碰撞检测,我正在考虑在动画中的每个精灵帧创建多个命中框,并在主游戏循环中检查它们之间的碰撞。是否有任何工具可以在精灵上创建命中框并生成此元数据(例如在 .plist 或 .xml 中)?
cocos2d iPhone 社区开发的其他 2D 格斗游戏如何处理碰撞检测和有用元数据的生成?
感谢您即将做出的回复。
I'm in the process of developing a 2D fighting game in the same style as Capcom's Street Fighter Alpha for the iPhone. For collision detection, I'm thinking about creating several hit boxes per sprite frame in an animation and checking for collisions between them in the main game loop. Are there any tools for creating hit boxes on sprites and generating this metadata (say in a .plist or .xml)?
How have other 2D fighting games developed by the cocos2d iPhone community handled collision detection and the generation of useful metadata?
Thanks for the forthcoming responses.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在格斗游戏中,实际上不执行(或者说不应该执行)碰撞检测。
您想要做的是确定当玩家 A 执行“攻击”时玩家 A 与玩家 B 的距离。玩家 A 的攻击是“静态”的:
然后,您可以根据执行的攻击、与玩家 B 的距离以及玩家 B 的当前状态来确定攻击是“落地”、“被阻止”还是“未击中”(高对蹲伏的敌人进行踢击是“未击中”,而对不在格挡中的蹲伏的敌人进行低踢攻击是“击中”)。
这是一系列的“规则”——如果两名玩家彼此之间的距离在特定距离内,并且每个玩家的攻击状态都是正确的,那么攻击者“着陆”,或者防御者“阻挡”或攻击者“错过”。
In a fighting game, collision detection is actually not performed (or should not be performed, that is).
What you would want to do is determine the distance of Player A from Player B when Player A performs an "attack". Player A's attacks are "static":
You would then determine, based on the attack performed and the distance to Player B, and the current state of Player B - whether the attack "landed", was "blocked" or "missed" (High Kick Attack against Crouched Enemy is "miss", while Low Kick Attach with Crouched Enemy NOT in Block is a "hit").
It's a series of "rules" - if the two players are within a specific distance of each other, and the states of each player are correct for the attack, then the attacker "lands", or the defender "blocks" or the attacker "misses".