Run Button = Animate Character

Ok, completely new to game making and gamesalad. Watched a few tutorials and have a very basic understanding.

I have a scene setup with a background, ground, character, run and jump buttons (making this for phones).

My character is animated using the animate behavior. However, I want it to remain still (turned off animate). so he's standing there when the run button is not pressed. BUT, when the run button (Run_BTN) is pressed I want it to animate the character (Character). I'll also need the ground to move but if I can get some guidance on how to animate the character when the run button is pressed I can figure out how to move the ground myself.

So, summary. Character displays standing picture by default (I achieved this by the actor pic). When the Run_BTN actor is pressed I need the character to animate. Can I turn the Animate behavior on and of via the Run_btn? Or how can I achieve this?

Thanks guys/ girls.

Comments

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    When you open game salad there are templates listed. Download the platformer template and you can look at the code for animating a character for all actions.
  • bds62bds62 Member Posts: 31
    edited February 2014
    That really just shows how to to animate via keyboard key. That's not hard. I need the Run_btn to animate the character when it receives touch. I can't seem to figure out how to link different actors together to interact. The Run_Btn will need pressed and then the character actor will then animate. I know how to animate it's just linking those two actors to perform desired function.
  • bjandthekatzbjandthekatz Orlando, FlMember Posts: 1,375
    Create an boolean attribute called jump (or whatever)
    Button:
    When the button is touched change jump to true
    Character:
    When jump is true Animate
  • bds62bds62 Member Posts: 31
    BJandtheKatz, you are a gentlemen and a scholar. Thank you very much. I really appreciate your help.
  • KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291
    @bds62 I also want to throw in that in either in the otherwise section or create another rule saying when touch is released, change jump to false. It needs something to tell it to change the boolean back to false when you aren't pressing it.
  • bds62bds62 Member Posts: 31
    Yea, I saw that happen and figured it out. I appreciate you mentioning that though sometimes I have moments of stupidity and forget things like that or can't figure out the obvious lol. Thanks @killerpenguinstudios
Sign In or Register to comment.