How do I make an actor jump?

AleksandrGamesAleksandrGames Member Posts: 54
edited November -1 in Working with GS (Mac)
I need to now how to make an actor jump.

In my scene I have a jump button and the actor. I want to know to make the jump button make the actor jump.

Help would be awesome. Thanks

Comments

  • AleksandrGamesAleksandrGames Member Posts: 54
    I need to now how to make an actor jump.

    In my scene I have a jump button and the actor. I want to know to make the jump button make the actor jump.

    Help would be awesome. Thanks
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    hey there

    First off make a integer game attribute, call it jump, and set it to 0.

    Next in your jump button have a rule when touch is pressed
    -change attribute jump to 1
    then open up the otherwise section of that rule and have a change attribute behavior changing jump to 0

    then finally in the actor you want to jump have a rule when attribute jump=1

    change attribute self motion linear velocity y to 350

    hope that helps
  • svnsvn Member Posts: 445
    Well doodlebob, here's what to do: Create a Game-level Integer attribute called Jump. In your jump button, create rule: when Touch is pressed, Change Attribute "game.Jump" to 1. In the otherwise section, put a Change Attribute "game.Jump" to 0.
    In your other actor, create a rule: When Attribute "game.Jump" is true, Change Attribute "self.motion.Linear.X" to [any positive number you like. Edit it to suit you]. NOTE: If the Scene Gravity is enabled, ignore the last step: In the otherwise section of the latter jump rule, put a Move behavior with the dial turned to 270. {Change the speed to suit you}.

    Hope this helps! If you're new here, then welcome. I would advise you to check out the CookBook, the tutorials at YouTube [http://www.youtube.com/user/GameSaladCookbook]. Just a thought.

    Again, welcome to GameSalad!
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    also merged your 2 threads. One thread per question please
  • johnydeejohnydee Member, PRO Posts: 196
    hey john how do i get the actor to land back on the ground?Mine just flies straight up and dosent come back down..
  • AleksandrGamesAleksandrGames Member Posts: 54
    johnydee187. did you add gravity? if you didn't add gravity than it won't come back down
  • johnydeejohnydee Member, PRO Posts: 196
    Doodle bob ...how do I add gravity?
Sign In or Register to comment.