Hi,
I’m asking myself a little question about how to launch annimation using acceleratometer.
To be clear, I would like to make my sprite running on left or on right depending of my acceleratometer value.
someone have an idea?
here is my current code (not working at the moment)
if (event.xGravity ==0) then
Joueur.stopAnim()
elseif event.xGravity \> currentXgravity then
Joueur.playAnim("RunLeft")
elseif event.xGravity \< currentXgravity then
patrick.playAnim("RunRight")
end
Joueur.mysprite.x = centerX + (centerX \* event.xGravity \*4)
Joueur.keepObjectIntoScene()
currentXgravity = event.xGravity
Thanks you for your advise :)…
Jonathan [import]uid: 44311 topic_id: 7781 reply_id: 307781[/import]