Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Wall Jump
- Alphawolf7130
-
Scratcher
20 posts
Wall Jump
Any ideas for a wall jump where if u jump onto a wall, you hang there until you let go of the key, and while you hang, if you press the opposite arrow/WASD key, you jump to the other wall? Griffpatch's idea in the platformer tutorial was good, but not what I wanted.
- ECLIPSE-STUDIOS
-
Scratcher
100+ posts
Wall Jump
Hiya,
I would go about this as follows -
I would use two sprites per level - one for the floors and ceilings (or anything horizontal or at a slight slope), and another for the walls (verticals and other steep slopes). Then, in my gravity script, I would say that if the user is holding an arrow that pushes them into a wall, as long as they continue to hold it, don't drop - this will also allow for the player to let go and grab the wall lower down.
I would use a custom block and enable the “run without screen refresh” option. This would work like your wall detection script, but on a clone. If the user is holding down an arrow, then the clone needs to move how the player would, and see if it collides with a wall. If it does, I would set a variable (perhaps called “onWall” etc.) to “left” or “right” depending on which side the wall was on., but in any other circumstance (including when the user just isn't pressing a key) the variable would be set to “none” etc.
In your gravity script, you will need to make sure the arrow key being held corresponds to the side the wall is on (ie left arrow, wall on left and vice versa).
Now in your left/right arrow (or W and D, if you're using WASD) simply create a jumping code where, if the user is holding on to a wall on the other side (ie left arrow, RIGHT side), then jump up and across to the left, at whatever angle/velocity you choose.
—
I didn't want to give you any code at this point, because I want you to have a chance to figure that out yourself, once you've got an idea of how to go about it, but if you need further explanation/code just let me know.
I hope this helps!
I would go about this as follows -
I would use two sprites per level - one for the floors and ceilings (or anything horizontal or at a slight slope), and another for the walls (verticals and other steep slopes). Then, in my gravity script, I would say that if the user is holding an arrow that pushes them into a wall, as long as they continue to hold it, don't drop - this will also allow for the player to let go and grab the wall lower down.
I would use a custom block and enable the “run without screen refresh” option. This would work like your wall detection script, but on a clone. If the user is holding down an arrow, then the clone needs to move how the player would, and see if it collides with a wall. If it does, I would set a variable (perhaps called “onWall” etc.) to “left” or “right” depending on which side the wall was on., but in any other circumstance (including when the user just isn't pressing a key) the variable would be set to “none” etc.
In your gravity script, you will need to make sure the arrow key being held corresponds to the side the wall is on (ie left arrow, wall on left and vice versa).
Now in your left/right arrow (or W and D, if you're using WASD) simply create a jumping code where, if the user is holding on to a wall on the other side (ie left arrow, RIGHT side), then jump up and across to the left, at whatever angle/velocity you choose.
—
I didn't want to give you any code at this point, because I want you to have a chance to figure that out yourself, once you've got an idea of how to go about it, but if you need further explanation/code just let me know.
I hope this helps!
- DerpyHead0
-
Scratcher
1000+ posts
Wall Jump
can you plz give the code PLZif you want that much done for you, you probably should go to the requests forum.
- superexe
-
New Scratcher
5 posts
Wall Jump
OK
go (help) steps
set [ i need help with wall hang] to [not true]
if <i get help > then
i can make a cool game YAY
end
Last edited by superexe (July 9, 2018 12:30:48)
- DerpyHead0
-
Scratcher
1000+ posts
Wall Jump
OKdon't blockspamgo (help) stepsset [ i need help with wall hang] to [not true]
if <i get help > then
i can make a cool game YAY
end
- Vibrato
-
Scratcher
1000+ posts
Wall Jump
My player on my platformer doesn't wall jump if he's on the right of the wall but he does if he is on the left of the wall. Help please!Please do not necropost. You have bumped someone needing help off of the first page.
- ddyyaabbccdd
-
Scratcher
3 posts
Wall Jump
Vibrato@ in the wall scrip you should not grab a new set xvel varible you should grag one in the wall script
- ddyyaabbccdd
-
Scratcher
3 posts
Wall Jump
when green flag clicked
if <> then
if <> then
else
end
else
end
(☁ score)(☁ score)(☁ score)(☁ score)(☁ score)(☁ score)(☁ score)pp
- Nolswit
-
Scratcher
100+ posts
Wall Jump
please don't necropost (Necroposting is posting on a thread/topic that is over a month old) if you need assistance, please make a new post
- Discussion Forums
- » Help with Scripts
-
» Wall Jump










