Discuss Scratch

maciej_sonski
Scratcher
29 posts

Need help in adapting my script to wall jumping !

Hi there, so I'm working on my new game and I'm using my old script from my older game. Is there away I can make the wall jumping possible without making completely new script ?

This is the link for the screenshot: https://drive.google.com/file/d/0B0aAklEZcYAIOG02OTVZWm5hdW8/view?usp=sharing
thoyal
Scratcher
500+ posts

Need help in adapting my script to wall jumping !

Can you share a link to the project?

Check out my studio! Check out this collaboration!

Want some quality music, art, or voice acting? Click here and we'll complete your order quickly!

—> DO NOT CLICK <— —> MY IDEA <—
maciej_sonski
Scratcher
29 posts

Need help in adapting my script to wall jumping !

thoyal wrote:

Can you share a link to the project?

https://scratch.mit.edu/projects/119230961/
lil_David
Scratcher
55 posts

Need help in adapting my script to wall jumping !

Griffpatch's tutorial has a part about wall jumping.
I've figured out a way to do more professional-looking wall jumping, but it's not perfect:

define check wall jump <left> <down> <right> <jump> <touching ground> <in air>
if <right> then //Makes sure you're pushing against a wall
change x by (1)
end
if <left> then
change x by (-1)
end
if <<<touching ground> and <in air>> and <not <down>>> then
change [on wall v] by (1)
if <right> then
look left :: custom
end
if <left> then
look right :: custom
end
set [yVel v] to ((yVel) * (wallMultiplier))
if <(jump held) = [1]> then
set [jumpLag v] to [15] //You can't jump while "jumpLag" is more than 0. Make it decrease each frame. I like it at half a second (15 frames)
set [touch ground v] to ((jumpHeight) - (wallJumpHeight))
if <(facing) = [R]> then //Or direction = 90
set [xVel v] to (speed) //You don't have to use a variable to store speed depending on your physics engine
else
set [xVel v] to ((-1) * (speed)
end
end
else
set [on wall v] to [0]
end
if <right> then
change x by (-1) //Reverses the move from the beginning
end
if <left> then
change x by (1)
end

Check out this stuff I made: Buy Stuff for More Money (Also clicking) | Open Chests for Loot | Mad Scientist Shoots Potato Chips | Platforming Plumber Simulator | Flaming Falcon-shaped Fists of Death | Running From the Final Boss Seems Popular | Stomp Goombas and Make Lives Useless | Stuff points at a thing | Mario by some dude on MFGG
Generation 4: the first time you see this copy and paste it on top of your sig in the scratch forums and increase generation by 1. Social experiment.
TheOnionBarji
Scratcher
6 posts

Need help in adapting my script to wall jumping !

If you were to use that custom block, what Boolean would you enter into the Boolean slots in the custom block? I can see how the block would work, but not how to differentiate between each when you refer to the custom block in your script.

Powered by DjangoBB