Lets assume I have some input function which decides which direction to run. The atlas file being referenced to the game object has 8 (isometric) walk animations (same frame count, one animation per 1/8 rotation). Thus, if the rotation changes I want to set another animation but with its cursor at the same time (For the user the object should only rotate without starting the animation again)
I tried to do the following in the on_input
function
self.cursor = go.get("#sprite", "cursor")
msg.post('#sprite','play_animation',{id = hash('run_5')})
go.set("#sprite", "cursor", cursor)
which is obviously not working because msg.post
is async thus line 3 runs after 2 is being executed. How to get this done properly?