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

Pergunta

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??

Foi útil?

Solução

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
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top