Getting a good Jump

YanayayaYanayaya Member Posts: 1

Hi everyone,

I'm new to game salad but have been working through the School of Interactive Designs training modules. What I wanted to know about was jumping, it's a question I've seen darted about in various places but those questions don't really cover what I need to know. My question is: I have a character that jumps when you touch the screen when you touch a button and you do so to avoid on coming obstacles. How do I make it so that if you keep your finger on the button the character doesn't just hover over everything? I tried applying a timer but it didn't seem to work.

Many thanks

A

Comments

  • SmokeyAce73SmokeyAce73 EarthMember Posts: 370

    Use when touch is released not when touch is down

    Developer For BLUNTentertainment - Feel Free To Message Me! - Free Beginner Templates!

  • stueynetstueynet TorontoMember Posts: 166

    @Yanayaya said:
    Hi everyone,

    I'm new to game salad but have been working through the School of Interactive Designs training modules. What I wanted to know about was jumping, it's a question I've seen darted about in various places but those questions don't really cover what I need to know. My question is: I have a character that jumps when you touch the screen when you touch a button and you do so to avoid on coming obstacles. How do I make it so that if you keep your finger on the button the character doesn't just hover over everything? I tried applying a timer but it didn't seem to work.

    Many thanks

    A

    Sometimes you want to have the player jump when touch is pressed not released so here is another solution.

    1) Make sure you have a force on the character keeping him on the ground. Either scene gravity or use an accelerate behaviour on him (I recommend the accelerate behaviour)

    2) Create a local attribute in the character to tell the game if he can jump or not. It should be a boolean. Call it canJump. I use a rule that detects if the player is currently touching the ground. So if Actor collides with Ground.

    3) When the Actor is in collision with the ground set canJump to true

    4) Create a rule to check if canJump is true and drop the jumping mechanics into that. As part of the jumping mechanics block, once the jump has started, make sure you set canJump to false.

    Now he won't be able to jump again until he is on the ground.

    My Latest GS Game - Tiny Spirit
    My First GS Game - Dashing Ralph

  • YanayayaYanayaya Member Posts: 1

    Excellent many thanks for all the info I'll get to it and let you know how things go. Cheers :)

Sign In or Register to comment.