Discuss Scratch

MrFluffyPenguins
Scratcher
1000+ posts

oh my god why

https://scratch.mit.edu/projects/449109232/

Holding the jump button on the trampolines in this platformer I'm making causes dumb stuff to happen. He jumps at a normal height, then goes much higher than he should. Can anyone help?
thewalkman
Scratcher
500+ posts

oh my god why

What if you made a variable called “if trampolining” that is set to “1” if the player is on a trampoline or in the motion caused by one? Then when the player is no longer affected by the trampoline, it switches to “0” again. When the variable is 1, the player's jump function could be disabled, and if it's 0, enabled.
nicklosimn
Scratcher
12 posts

oh my god why

I think that if you hold jump it will add the trampoline and you jump together
try to add this in the W key is pressed

if <touching [ trampoline] ?> then
set [ velocity] to [0]
end
try that
MrFluffyPenguins
Scratcher
1000+ posts

oh my god why

nicklosimn wrote:

I think that if you hold jump it will add the trampoline and you jump together
try to add this in the W key is pressed

if <touching [ trampoline] ?> then
set [ velocity] to [0]
end
try that
i tried it before, didnt work

thewalkman wrote:

What if you made a variable called “if trampolining” that is set to “1” if the player is on a trampoline or in the motion caused by one? Then when the player is no longer affected by the trampoline, it switches to “0” again. When the variable is 1, the player's jump function could be disabled, and if it's 0, enabled.
ill try it

Last edited by MrFluffyPenguins (Nov. 20, 2020 14:05:37)

MrFluffyPenguins
Scratcher
1000+ posts

oh my god why

thewalkman wrote:

What if you made a variable called “if trampolining” that is set to “1” if the player is on a trampoline or in the motion caused by one? Then when the player is no longer affected by the trampoline, it switches to “0” again. When the variable is 1, the player's jump function could be disabled, and if it's 0, enabled.
That works, partially, but it still lets the player go much higher if they hold the jump button.
thewalkman
Scratcher
500+ posts

oh my god why

Mr_PenguinAlex wrote:

thewalkman wrote:

What if you made a variable called “if trampolining” that is set to “1” if the player is on a trampoline or in the motion caused by one? Then when the player is no longer affected by the trampoline, it switches to “0” again. When the variable is 1, the player's jump function could be disabled, and if it's 0, enabled.
That works, partially, but it still lets the player go much higher if they hold the jump button.
Did you test it with the variable showing?
TimeClox
Scratcher
4 posts

oh my god why


I dontkknow

Last edited by TimeClox (Nov. 20, 2020 18:39:04)

thewalkman
Scratcher
500+ posts

oh my god why

Does your regular jump script state that the player has to be touching the ground?

Last edited by thewalkman (Nov. 20, 2020 18:40:40)

MrFluffyPenguins
Scratcher
1000+ posts

oh my god why

thewalkman wrote:

TimeClox wrote:

I dontkknow
How will that fix the bug?
the bug has already been fixed, i decided to use the thing where you can go higher as a feature

Powered by DjangoBB