I have a sprite with physics which should change its walking direction everytime it hits a barrier. How can I flip the sprite along with it physics, so that it can move in the opposite direction (it can only move left or right). [import]uid: 74852 topic_id: 12462 reply_id: 312462[/import]
Do this code:
[lua]object.rotation = 180 [/lua]
See this link: http://developer.anscamobile.com/content/objectrotation
You could then do a transition.to function to make the object rotate smoothly. [import]uid: 29181 topic_id: 12462 reply_id: 45542[/import]