Jumping issues.

Hey everyone,
I am having issues with my jump. I have gotten my actor able to jump and he jumps well. I have two problems:


1. If I hold the space bar down (that is my key to regulate the "jumping" bool value), he will continue to jump every time he comes in contact with the ground. What I am looking for is a way to force the user to release the space bar in order to jump again. I feel that this will avoid any unwanted jumping all over the screen if you're nervous.

2. My second problem with jumping is that when my actor comes in contact with the side of one of my platforms, jump is enabled and he jumps! I don't want him to jump when he collides with the side. Only the top. Now, I've watched the Jamie Cross videos and am aware of the game.platformTop attribute i could make; however, because my platform actors are above and below my player actor at all times, I feel as though this attribute is useless if used with the platform (prototype) actor. Simply put, I can't say "when game.playerBottom = game.platformTop enable jump" because the next platform he needs to get to has a game.platformTop that is greater than him.

I hope that wasn't too confusing. Thank you for any help.

Comments

  • UtopianGamesUtopianGames Member Posts: 5,692
    Hi and welcome to the forums, FYI we have made several quality platform templates that might help you over at DBA.

    Bit confused with this as i would expect to be able to jump as soon as i hit the ground and pressed jump? Or do you mean user presses jump lets go and he jumps as soon as he hits the platforms?

    It sounds like your auto jumping when you collide with a platform?

    http://www.deepblueapps.com/?s=platform&x=-1222&y=-47

    Darren.



  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    Keyboard keys repeat, that's just how they work if you hold a key down, it's not a GS thing. If you want to stop that from happening you'd have to add a timer delay or some other flag to stop jumping for a certain period of time.

    For the jumping when you hit the sides of a platform, the easiest fix for that is probably to use two different actors for each platform. One that is just scenery and the player doesn't collide with it, and another invisible actor that the player actually collides with. This invisible actor would not overhang the sides or bottom of the scenery platform, it would just be along the top.
  • jestrada2006jestrada2006 Member Posts: 2
    I do want him to jump when colliding with the ground. I just want to eliminate the ability to hold down the space bar and jump every time there is a collision. The key is holding down the space bar. If it is held down he will jump with every collision after the first. I want the user to have to release the spacebar in order to jump again after the second collision.

    Imagine this:
    Not moving and hold down space bar for 10 seconds. Every time he hits the ground he jumps. I want it to where he only jumps once. You have to release the key in order to be able to jump again.

    Hope that's clearer.

    Thanks for the templates!
  • BellowBellow Bartender Member, PRO Posts: 227
    make rule if jumps change game attribute ture and if key space up change game attribte false

    this way its now going to jump everytime when you hold
Sign In or Register to comment.