Discuss Scratch

CSLLucasC3
Scratcher
21 posts

how to make a sprite jump realistically

this is how to make a sprite jump… but realistic.


first, you need the sprite that will be jumping. mine's is pikachu!


[https://projectpokemon.org/images/normal-sprite/pikachu.gif

you can also add a background.

now, add a “gravity” variable. if you have multiple sprites, make one “gravity” variable for each sprite so they will all jump.

gravity

then add this code to your first sprite:



when spacekeypressedset gravityto15repeatuntilgravity=-16changeybygravitychange gravityby-1

that will make it go down every time and eventually stop at it's staring position.

there! and that's it! to use that for more sprites, copy the code to that sprite and change the “gravity” variable to that sprite's variable. like:

gravity2

bye!
CSLLucasC3
Scratcher
21 posts

how to make a sprite jump realistically

CSLLucasC3 wrote:

this is how to make a sprite jump… but realistic.


first, you need the sprite that will be jumping. mine's is pikachu!


[https://projectpokemon.org/images/normal-sprite/pikachu.gif

you can also add a background.

now, add a “gravity” variable. if you have multiple sprites, make one “gravity” variable for each sprite so they will all jump.

gravity

then add this code to your first sprite:



when spacekeypressedset gravityto15repeatuntilgravity=-16changeybygravitychange gravityby-1

that will make it go down every time and eventually stop at it's staring position.

there! and that's it! to use that for more sprites, copy the code to that sprite and change the “gravity” variable to that sprite's variable. like:

gravity2

bye!
me special
SimpleArt321
Scratcher
8 posts

how to make a sprite jump realistically

but if ya jump then move to a lower platform, player will stand on mid air
coder12679
Scratcher
0 posts

how to make a sprite jump realistically

I just want to find something to make my sprites jump and the basic skills to make a platform game
CSLLucasC3
Scratcher
21 posts

how to make a sprite jump realistically

SimpleArt321 wrote:

but if ya jump then move to a lower platform, player will stand on mid air
i'm not talking about platformers
mmnagelia
Scratcher
100+ posts

how to make a sprite jump realistically

Hmm, are you asking for help, or giving a tutorial? Because this isn't the place for tutorials; this is for questions and help.

Last edited by mmnagelia (Dec. 20, 2020 02:08:18)

Nezon
Scratcher
1000+ posts

how to make a sprite jump realistically

I'm going to report this to be closed as it's a random tutorial for jumping.

Help with Scripts works like someone asks for help, explains their problem, then someone actually comes and helps solve the problem.

Harakou
Scratcher
1000+ posts

how to make a sprite jump realistically

Hi! It's great that you want to offer some useful tips to other users, but this forum isn't meant for tutorials. Instead, why not create a project and share it in the Show and Tell forum? That way, people can see the scripts you're demonstrating in action, change them easily and remix your project if they want to.

Powered by DjangoBB