Stop wall jumping?
G3ck0
Member Posts: 12
So I found a pretty big problem with my platformer; you can wall jump off of pretty much anything. Platforms and walls etc. It would make it hard to design levels around this, as you could just scale any walls. Can I make it so you can only wall jump certain surfaces, or turn off wall jumping altogether?
Comments
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
For example if you want to only allow your player to jump off floors and NOT walls you need to distinguish between the two surfaces in your rules.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
You'll need to check in your behavior(s) what the player is touching of course and only allow jumping off the floor.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
-Make a boolean that tells the player when his jump is ready
-Make a Player Y real attribute and constrain it to your players Y coordinates
Make a rule like this in your platforms/floors/walls:
-If Player Y is > self.y+(self.height/2) AND is overlap/collide with Player
-Change Attribute JumpReady to TRUE
In the player actor just have your jump rule only work if JumpReady is TRUE
This way the player can only jump if they're on top of the wall/platform/floor.
Hope I explained that well enough.
If the JumpReady attribute isn't changing to true make sure you're platforms have a rotation of zero and also try changing this:
-If Player Y is > self.y+(self.height/2) AND is overlap/collide with Player
-Change Attribute JumpReady to TRUE
to this:
-If Player Y is > self.y+(self.height/1.99) AND is overlap/collide with Player
-Change Attribute JumpReady to TRUE
Now you don't need to lay down a second set of floor actors!
how do you stop the jump count of an actor reseting when you touch the bottom/sides of a platform
I did it this way. I constrained a small invisible actor/hitbox underneath the player, that only extends below him 1-3 pixels, and not in any othe rdirection. THAT is the actor i have looking for the player to be on the ground, which then switches on a global OnGround attribute. Once that is active, the jump count resets. Ever since someone(sorry! I honestly forget who!) suggested it to me, I've been using bounding boxes like that a lot in my character behaviors.
Do you think you can share how you do this? I am struggling to get this.