Freeze game rotation

Guys,

How have they done the rotation of the hero on freeze?

It looks like the outer edges move based on physics… but the inner face does not rotate (fixerotation = true)

where the face always stays up right but the outer seems to rotate? is that a ball inside a ball?

see

http://www.coronalabs.com/blog/2012/12/03/app-of-the-week-freeze/
[import]uid: 67619 topic_id: 33793 reply_id: 333793[/import]

If I were to recreate it I would make the spiky ball physics based and then add a separate non-physics based image for the eye and update its translation each frame to match the spiky ball’s. The eye will move around the screen, but it won’t rotate. [import]uid: 109535 topic_id: 33793 reply_id: 134366[/import]

how do you add a non based physics image for the eye onto the spiky ball? [import]uid: 67619 topic_id: 33793 reply_id: 134422[/import]

Create the spiky ball, then add a physics body to it. Create the eye, and don’t add a physics body to that. Then in an enterFrame function tell the eye object to move to the position of the spiky ball each frame e.g eye.x = spikyBall.x.

A cleaner way to do it would be to add physics bodies to both objects. Then make sure they can’t collide with each other, add a pivot joint, and set eye.isFixedRotation = true.

[import]uid: 109535 topic_id: 33793 reply_id: 134436[/import]

If I were to recreate it I would make the spiky ball physics based and then add a separate non-physics based image for the eye and update its translation each frame to match the spiky ball’s. The eye will move around the screen, but it won’t rotate. [import]uid: 109535 topic_id: 33793 reply_id: 134366[/import]

how do you add a non based physics image for the eye onto the spiky ball? [import]uid: 67619 topic_id: 33793 reply_id: 134422[/import]

Create the spiky ball, then add a physics body to it. Create the eye, and don’t add a physics body to that. Then in an enterFrame function tell the eye object to move to the position of the spiky ball each frame e.g eye.x = spikyBall.x.

A cleaner way to do it would be to add physics bodies to both objects. Then make sure they can’t collide with each other, add a pivot joint, and set eye.isFixedRotation = true.

[import]uid: 109535 topic_id: 33793 reply_id: 134436[/import]