Discuss Scratch

GJtheLegend
Scratcher
20 posts

Wall Jumping

I am making a platformer and I want wall jumping to be in it, but I don't know how to make it! any tips?
Alberknyis
Scratcher
1000+ posts

Wall Jumping

If you know how to make a regular platformer, then wall jumping is an extension that comes in two parts: Detecting a wall and activating a walljump.

Detecting a wall:



When you move horizontally, touching the level means touching a wall (unless there's slopes, then it's a bit more advanced). If you're touching a wall, you can walljump. So inside your wall detecting script add a check to see if the player is jumping, and which direction the walljump should go.

Activating a walljump:



This part is far easier and requires no explanation.

You may notice that this method only works if you're pushing into the wall. If you're not, it won't jump. You can separate the walljump detection into its own script where it moves left and right one pixel to check if its next to a wall.
GJtheLegend
Scratcher
20 posts

Wall Jumping

Thank you SOOO much!
GJtheLegend
Scratcher
20 posts

Wall Jumping

But what do I put under Define uncollide?
GJtheLegend
Scratcher
20 posts

Wall Jumping

What are xvel and yvel?
GJtheLegend
Scratcher
20 posts

Wall Jumping

Is the sprite: Level, my ground sprite?
GJtheLegend
Scratcher
20 posts

Wall Jumping

Alberknyis wrote:

If you know how to make a regular platformer, then wall jumping is an extension that comes in two parts: Detecting a wall and activating a walljump.

Detecting a wall:



When you move horizontally, touching the level means touching a wall (unless there's slopes, then it's a bit more advanced). If you're touching a wall, you can walljump. So inside your wall detecting script add a check to see if the player is jumping, and which direction the walljump should go.

Activating a walljump:



This part is far easier and requires no explanation.

You may notice that this method only works if you're pushing into the wall. If you're not, it won't jump. You can separate the walljump detection into its own script where it moves left and right one pixel to check if its next to a wall.
But what do I put under Define uncollide?
GJtheLegend
Scratcher
20 posts

Wall Jumping

Alberknyis wrote:

If you know how to make a regular platformer, then wall jumping is an extension that comes in two parts: Detecting a wall and activating a walljump.

Detecting a wall:



When you move horizontally, touching the level means touching a wall (unless there's slopes, then it's a bit more advanced). If you're touching a wall, you can walljump. So inside your wall detecting script add a check to see if the player is jumping, and which direction the walljump should go.

Activating a walljump:



This part is far easier and requires no explanation.

You may notice that this method only works if you're pushing into the wall. If you're not, it won't jump. You can separate the walljump detection into its own script where it moves left and right one pixel to check if its next to a wall.
There are a few problems with this
  • What triggers this?
    what do I put under Define uncollide?

Last edited by GJtheLegend (July 21, 2022 19:45:13)

Maxplonk
Scratcher
20 posts

Wall Jumping

IT DIDNT WORK

Powered by DjangoBB