Discuss Scratch

GJbusyScratching
Scratcher
20 posts

idk how to make a jump animation

soooo basically what the title says… but like i just dont get how it works…
Spentinium
Scratcher
100+ posts

idk how to make a jump animation

A very bare bones and basic jumping script would be this:

whenclickedsety speedto0foreverchangey speedby-1changeybyyspeediftouchingground?thenchangeyby0-yspeedsety speedto0whenIreceivejumpsety speedto15

This isn't a particularly good jumping script, but it teaches the fundamentals.

Last edited by Spentinium (July 13, 2023 07:52:24)

GJbusyScratching
Scratcher
20 posts

idk how to make a jump animation

no but for an animation
Spentinium
Scratcher
100+ posts

idk how to make a jump animation

GJbusyScratching wrote:

no but for an animation
In that case, you can use anticipation and perhaps a bit of stretch / squash.

You must know how to draw a person / character that will jump.

Before your character jumps, have their knees bend down for anticipation. The viewer will expect the character to jump because of this bending action. Although it's exaggerated it will provide good anticipation.

While your character is travelling up / down in the air, you may consider stretching your character vertically and squashing it horizontally a little bit. This will emphasize the speed and motion of your character. Don't overdo it though. When your character lands, have it squashed vertically and stretched horizontally to emphasize the impact on the ground.

I hope this helps!
scratchcode1_2_3
Scratcher
1000+ posts

idk how to make a jump animation

Yes, you should do what spentinium said, but there is another technique Spentinium didn't mention. Ease in and ease out. Well, what does that mean?

Ease in is when the animation starts slow, and gradually speeds up to the end of the animation. This can help when simulating gravity or just making smooth animations. Here's an example of ease in:



Ease out is the exact opposite of ease in, meaning that it starts fast, and gradually slows down. Here's an example of ease out:


You can also combine both!



You can make all sorts of cool flips with this! Like with my character, even though he's not human:



Hope this helps!

Last edited by scratchcode1_2_3 (July 13, 2023 14:28:37)

GJbusyScratching
Scratcher
20 posts

idk how to make a jump animation

sorry but what i am saying is that im trying to just switch a costume when jump key is pressed but idk how to make that
iIovef4f
Scratcher
100+ posts

idk how to make a jump animation

GJbusyScratching wrote:

sorry but what i am saying is that im trying to just switch a costume when jump key is pressed but idk how to make that
Create a variable called grounded. Next to the jump condition, set it to true. Each new frame set it to false. Then if grounded is false then use the jump costume.
grounded=falsegroundcollisionOnground?Getoutofgroundcheckifjumpkeygrounded=trueifgroundedisfalsethenjumpcostume

Last edited by iIovef4f (July 14, 2023 14:45:53)

CloudyWhale
Scratcher
64 posts

idk how to make a jump animation

y = -(fallspeed)x^2 + (jump velocity)x

x is the time since the player pressed the jump button
be aware that this equation will go into the negatives and it starts at 0
CloudyWhale
Scratcher
64 posts

idk how to make a jump animation

Also if something is right after the parentheses without any sign that is multiplication
NIKI-KOLCHAGOV
Scratcher
500+ posts

idk how to make a jump animation

Hmm i think there are a lot of different ways to make jumping but i made it with sine
And the code should look something like this

whenclickedwait0.01secsforeversetJump Powerto50ifkeyspacepressed?thensetCounterto0repeat5changeCounterby1changeybysinofCounter*JumpPower*3.659setCounterto0repeat7changeCounterby1changeybyjoin-sinofCounter*JumpPower*1.96waituntilkeyspacepressed?

You can change the jump power by changing the variable Jump Power to different numbers i set it to 50 but you can make it lower or higher

Powered by DjangoBB