plz help with double jump

kittyra1nkittyra1n Member Posts: 10
edited March 2015 in Working with GS (Mac)

[threads merged by moderator... see below]

Comments

  • RossmanBrothersGamesRossmanBrothersGames Member Posts: 659

    You don't need to pay someone, learning how to do it on your own will be more beneficial in the future.

    Here is my advice

    Have two attributes

    One a boolean called GROUNDED

    The other an integer called JUMPNUMBER

    Make these Rules

    If
    Button Pressed
    AND
    JUMPNUMBER is less than 2

    Then
    Change vertical velocity to 500
    Change JUMPNUMBER to JUMPNUMBER + 1

    If overlap with ground
    change GROUNDED true
    otherwise
    change GROUNDED false

    if GROUNDED is true
    change JUMPNUMBER to 0

    for gravity make the character Accelerate downward

    this will make it so that pressing a button will make you jump, and pressing it again will make you jump again, it will not jump a third time because JUMPNUMBER will equal 2, landing on the ground will reset JUMPNUMBER

  • kittyra1nkittyra1n Member Posts: 10

    @RossmanBrothersGames I knew I would get an answer like that! & its true, but I need to to release this game asap.

    So I will try your instructions, but they dont look any different from the tutorial.

    & u didnt specify which actors I need to change the attributes on, I had some issues because the the jump button is the whole background of the game, & whenever I add the attributes to the characther I can't get those attributes to show up under the jump actor to correspond it.

    Please be as detailed as possible, thank you so much! I wont go to bed until I figure this out

  • kittyra1nkittyra1n Member Posts: 10

    @RossmanBrothersGames im trying it now hold on

  • kittyra1nkittyra1n Member Posts: 10

    @RossmanBrothersGames it didnt work! I copied everything exactly how you said, check my screenshots,
    http://imgur.com/CjfUGae,PimUUPn,2RjowK8#0

  • kittyra1nkittyra1n Member Posts: 10

    I can't get my character to only jump twice, I've tried all the gamesalad tutorials, even the one directly addressing this but I still can't figure it out.

    Here is my current set up, even with these settings my character keeps jumping.
    http://imgur.com/CjfUGae,PimUUPn,2RjowK8#0

  • kittyra1nkittyra1n Member Posts: 10
    edited March 2015

    The screenshots correspond to the "player" actor.

    Also check out the background actor because that's what controls the jump, but im not sure if I need to edit anything there for the double jump.

  • ArmellineArmelline Member, PRO Posts: 5,421
    edited March 2015

    You're overcomplicating things for yourself. I'm PMing you a fix for your problem. I'd recommend taking down the link to your project, that's a lot of project to be posting!

    In broad terms for anyone else reading, the solution is to place the limit on how many jumps (self.jump number) as a condition for the standard jump.

    if jump is true and if self.jump number < 2
    ...perform jump logic
    ...change attribute self.jump number to self.jump number+1

    Then have self.jump number reset back to 0 when the actor next collides with the ground (or however else you register a jump as being over).

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    @kittyra1n, I've updated the file you sent me this morning. I'll email it to you shortly with a description of what I did. It's working fine now.

  • jigglybeanjigglybean Member Posts: 1,584

    You've made 2 posts on this. One will probably be closed. here is a tutorial.

  • kittyra1nkittyra1n Member Posts: 10

    @jigglybean how can i close this one?

  • jigglybeanjigglybean Member Posts: 1,584

    A mod will do it when they are around, so don't worry.

  • kittyra1nkittyra1n Member Posts: 10

    thanks, solved

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    You're welcome :)

Sign In or Register to comment.