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.
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
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.
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.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
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!
this way its now going to jump everytime when you hold