Discuss Scratch

Roboplays75
Scratcher
10 posts

how do you jump but then go back on the ground?

Hello! I am working on a game and I need to make my sprite jump, so I went to tips-how_to-and tried to find the directions to make your sprite jump but I couldn't! Can you help me?<–(happy faces)
TheCookieHero880
Scratcher
100+ posts

how do you jump but then go back on the ground?

Are you making a platformer? If so you can use somebody else's code from a tutorial, such as @djpro 's script. (https://scratch.mit.edu/projects/34429446/)
tgbatman8
Scratcher
27 posts

how do you jump but then go back on the ground?

how I make my sprites jump is like this

foreverifkey Up arrowpressed?thenchangeyby20wait1secschangeyby-20
tgbatman8
Scratcher
27 posts

how do you jump but then go back on the ground?

tgbatman8 wrote:

how I make my sprites jump is like this

foreverifkey Up arrowpressed?thenchangeyby20wait1secschangeyby-20

also add

whenclicked

hope it helps
TheScratchLemon
Scratcher
36 posts

how do you jump but then go back on the ground?

whenclickedforeverifnottouching ground?thenchangeyby-10whenspacekeypressedrepeat10changeyby20
Nightpytt
Scratcher
69 posts

how do you jump but then go back on the ground?

when spacekeypressedrepeat10changeyby5wait.1secsrepeat10changeyby-5wait.1secs

Last edited by Nightpytt (Dec. 5, 2016 23:39:23)

nickeljorn
Scratcher
1000+ posts

how do you jump but then go back on the ground?

Roboplays75 wrote:

Hello! I am working on a game and I need to make my sprite jump, so I went to tips-how_to-and tried to find the directions to make your sprite jump but I couldn't! Can you help me?<–(happy faces)

My trick:

whenclickedforeverifkeyup arrowpressed?thensetYvelto10repeat20changeybyYvelchangeYvelby-1
billkideddeded23122
Scratcher
1 post

how do you jump but then go back on the ground?

movestepsstopallsoundsplaydrumfor0.25beatsrestforbeatsrestforbeatssetpencolortosetpencolortoifthenifthenkeypressed?endend
and yah
ChessProking-tm
Scratcher
58 posts

how do you jump but then go back on the ground?

When Flag Clicked
Forever
< If Key Space Pressed >
Change Y by 10
Repeat 10 Times
Change Y by -1

whenclickedforeverifkeyspacepressed?thenchangeyby10repeat10changeyby-1waituntilnotkeyspacepressed?

Last edited by ChessProking-tm (May 31, 2024 19:13:29)

Powered by DjangoBB