Help with touch movement

ChobbifaceChobbiface PRO Posts: 491
edited November -1 in Working with GS (Mac)
Just wondering if anyone has got a demo on touch movement. I have been working on this for hours and hours but can't seem to get it quite right!

Basically, I have a forward facing character in the middle of the screen at rest. When I touch to the right, I want him to turn right and walk there (with animation. I have done the animation images). When I touch to the left, he will then walk to the left. I can make the character move to the right place at the moment but my difficulty is getting him to switch from right to left animation appropriately. Can anybody help out?

Thanks

Comments

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Add in a change image behavior before running the animation so touch x is greater than self.postion.x change image to actor right then have a second rule if self.linearvelocity.x is greater than 0 and self.image equals actorright.png play animationright etc…

    That may work for you. who knows. I've not messed with those types of games yet just puzzles.
  • ChobbifaceChobbiface PRO Posts: 491
    Thanks. I will that a try in a moment and see how it goes :)
  • ChobbifaceChobbiface PRO Posts: 491
    Dude, you're just total awesomeness. Went along with what you said, had to add some modifications to make it work, but now it works like a charm! Finally, I must have spent 12 + hours figuring out how to do it, your suggestion was straight to the point. Maybe I should add a tutorial to do this for newbies like myself.

    Thanks again!

    Chobbipod
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Glad to help. grab a promo code for my game if there are any left
    http://gamesalad.com/forums/topic.php?id=15166
Sign In or Register to comment.