touch control/ animation problem please help

Hipster_Owl_StudiosHipster_Owl_Studios Member, PRO Posts: 214
edited March 2012 in Working with GS (Mac)
hello all! I am confused on some touch control rules and the animations that relate to them.

how can i set a jumping animation facing right and another jumping animation facing left with the same jump button.

if this seems confusing in other words i just need help on how to make my actor move left and right with the correct animations,

Answers

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Make a attribute called animationState.

    Rule: when attribute self motion linear x >0
    -change attribute animationState to 1

    Rule: when attribute self motion linear velocity x < 0
    -change attribute animationState to 2

    Rule: when jump button is pressed and animation state=1
    -animate(facing right animation)

    Rule: when jump button is pressed and animation state=2
    -animate(left facing animation)

    cheers
  • Hipster_Owl_StudiosHipster_Owl_Studios Member, PRO Posts: 214
    do i add this to my main actor correct? what attributes do i add in my touch controls?
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Yes put it in the actor your want to animate, the main actor(the player)

    And the only attribute you have to create yourself is the animationState attribute
  • Hipster_Owl_StudiosHipster_Owl_Studios Member, PRO Posts: 214
    ok thank you I'm working on it now!
  • deadlightsdeadlights Member, PRO Posts: 235
    Just wanted to hop in here to thank JP - it worked beautifully.
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Try these touch control I made for my game it's a touch left and right and it knows which way you're facing so when you are going right and also touch the left side of the screen the actor jumps and the reverse for left. http://gleesongroupmedia.com/templates/Multitouch_Jump_and_Run_Controls.zip

    Btw: tons of notes included in the rules.
  • deadlightsdeadlights Member, PRO Posts: 235
    Thanks!
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Thanks, Bacon!
Sign In or Register to comment.