Predicting collision before it happens with cocos2d

最后都变了- 提交于 2019-12-25 16:53:18

问题


I thought about writing a new question, because there were too many comments and some other people could not get the proper idea of my doubt.

For this, I have posted my GameScene on Git: https://github.com/henriquesv/iOS_Tests/blob/master/GameScene.m

Summerizing: This is a game where I have a few pipes connected and some pieces start already inside of them. The user can touch each piece at a time and slide them through the tubes.

So, I have to be able to move each piece with a finger. The pieces cannot pass through the pipes (you can look at the piece of code where I check for some Areas). And each piece cannot overlap each other.. they are a barrier to each other.

What is the problem now?

The pipe areas are being respected (ok!), but the pieces are being overlapped by a few pixels and then they get stucked because on the next move they are already overlapped.

Any ideas?

Thank you!

来源:https://stackoverflow.com/questions/20882442/predicting-collision-before-it-happens-with-cocos2d

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!