Player jumping?

Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
edited November -1 in Working with GS (Mac)
I need to have my player jump when he touches the iphone/ipad screen.
Any help would be really good

Maybe when you hold it longer, he jumps higher.
Anything ;)

Thanks!

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    create a attribute called jump. Create a actor, drag it over the whole scene, and change its alpha to 0 so its invisible( or even better turn visible off in it graphics attributes)

    Now in the actor you dragged over the whole scene make a rule:

    when touch is pressed
    -change attribute jump to 1
    then open up the otherwise section of that rule and put a change attribute behaviro in there changing jump to 0 (that wil make it so when the screen is not being pressed, jump=0)

    then finally in your player have a rule when attribute jump=1
    change attribute self motion linear velocity to 300 (adjust the 300 to your jump height)

    cheers
  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    Cool thanks, but how do i do this step:
    -change attribute jump to 1

    I cant find that.

    Or, when you said: create a attribute called jump
    What does that mean?
    What i did is I see a 'actors', 'atributes' and 'devices'
    I made a 'rump' in the 'atributes' Is that what i am supposed to do?

    If so, then there are many setting when i make one.
    'Boolean', 'text', 'integer', 'real', 'angle', and 'index'
    Am i supposed to choose one of those?
  • svnsvn Member Posts: 445
    Here's a good idea:
    Start with JohnPapiomitis's giant invisible actor. Create two boolean attributes : Jump and Grounded. Tell attribute Grounded when the player touches the ground, the attribute Grounded is On, otherwise its Off. Then tell the attribute Jump when the Jump actor is touched, change attribute Jump to On, otherwise its Off. Now, tell the player actor that when both attributes Jump and Grounded are on, change attribute self.Motion.Linear.X to (any positive number you want).
    Hope this helps.
    Cheers, svn
Sign In or Register to comment.