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