Distance the object is drop from the pulley system (Similar to Angry Bird game) Using Cocoa2D and Box2D in IOS

StackOverflow https://stackoverflow.com/questions/22886295

i am using cocoa2d and Box2D frame for implementing functionality IOS App similar to angry bird game, using the code from following link Source Code

But i need to calculate the distance the bird (any object from the spring) that has landed from the actual spring stands

Can you please let me know is there any solution to find out the distance??

有帮助吗?

解决方案

Isn't it just the same as the distance between any two objects?

Actually, even easier, because you really only need the distance on the x axis.

 m_bulletBody->GetPosition().x - m_armBody->GetPosition().x
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top