2D 格斗游戏的碰撞箱。工具?

发布于 2024-09-30 01:00:59 字数 232 浏览 3 评论 0原文

我正在开发一款 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

无可置疑 2024-10-07 01:00:59

在格斗游戏中,实际上不执行(或者说不应该执行)碰撞检测。

您想要做的是确定当玩家 A 执行“攻击”时玩家 A 与玩家 B 的距离。玩家 A 的攻击是“静态”的:

High Punch = 64px reach
Low Punch = 54px reach
Mid Punch = 45px reach
High Kick = 64px reach
etc, etc, etc

然后,您可以根据执行的攻击、与玩家 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":

High Punch = 64px reach
Low Punch = 54px reach
Mid Punch = 45px reach
High Kick = 64px reach
etc, etc, etc

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".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文