Discuss Scratch

10yearoldgamers
Scratcher
21 posts

How do you make a sprite jump? cause it doesnt come back down if i just make it press the up button.

How do you make a sprite jump? cause it doesnt come back down if i just make it press the up button? if you could help me that would mean a lot!
scubajerry
Scratcher
1000+ posts

How do you make a sprite jump? cause it doesnt come back down if i just make it press the up button.

I assume you next question is how do you get it to stop coming down.

There are tons of ways for both. This is probably isn't the best, but it is one way. http://scratch.mit.edu/projects/12969047/
10yearoldgamers
Scratcher
21 posts

How do you make a sprite jump? cause it doesnt come back down if i just make it press the up button.

scubajerry wrote:

I assume you next question is how do you get it to stop coming down.

There are tons of ways for both. This is probably isn't the best, but it is one way. http://scratch.mit.edu/projects/12969047/

is there any way there can be a simpler one? xD i am new to this soooo ya xD
turkey3_test
Scratcher
1000+ posts

How do you make a sprite jump? cause it doesnt come back down if i just make it press the up button.

when key [up arrow v] pressed //when you press the jump button
set [y velocity v] to (6) //"y velocity" is the vertical speed of a sprite
repeat (12)
change y by (y vel)
change [y velocity v] by (-1)
end
scubajerry
Scratcher
1000+ posts

How do you make a sprite jump? cause it doesnt come back down if i just make it press the up button.

10yearoldgamers wrote:

scubajerry wrote:

I assume you next question is how do you get it to stop coming down.

There are tons of ways for both. This is probably isn't the best, but it is one way. http://scratch.mit.edu/projects/12969047/

is there any way there can be a simpler one? xD i am new to this soooo ya xD

Yes = Turkey's response does a jump and back down and down and down. I don't know what you are doing with the jumper, but I predict that you will want to do most of the things in my project.
- Move left and right
- Go off the screen
- Stop falling.
Landrover110
Scratcher
100+ posts

How do you make a sprite jump? cause it doesnt come back down if i just make it press the up button.

See here for advanced jumping
Hope it helps
FalconGunner99
Scratcher
1000+ posts

How do you make a sprite jump? cause it doesnt come back down if i just make it press the up button.

I remixed a project about jumping and made it pretty smooth and simple I think. I can't link cause I'm on mobile but it should be in my profile.
AlSweigart
Scratcher
98 posts

How do you make a sprite jump? cause it doesnt come back down if i just make it press the up button.

I have a complete video tutorial on implementing jumping and gravity here: http://inventwithscratch.com/double-jump-demo/
rainierroitayam
Scratcher
100+ posts

How do you make a sprite jump? cause it doesnt come back down if i just make it press the up button.

when green flag clicked
forever

set [x vel] to [((x vel) * (98.99)) ]
set [y vel] to [((y vel) * (98.99)) ]
end
is the correct script for the xy velocity?

Last edited by rainierroitayam (Sept. 30, 2014 07:53:57)

dillpikle
Scratcher
16 posts

How do you make a sprite jump? cause it doesnt come back down if i just make it press the up button.

i tried turkey3 test's programming and it worked!
maxwellblue
Scratcher
15 posts

How do you make a sprite jump? cause it doesnt come back down if i just make it press the up button.

lets make it easy and do:
when [up arrow] key pressed
repeat (10)

change y by (10)
end
repeat (10)

change y by (-10)
end
adynlavine
Scratcher
39 posts

How do you make a sprite jump? cause it doesnt come back down if i just make it press the up button.

when green flag clicked
forever

if <not <touching [ground sprite] ?>> then
set [yv] to [-1]
repeat until <touching [ground sprite] ?>

wait (.1) secs
change y by (yv)
change [yv] by (-2)
end


end

end

when green flag clicked
forever

if <key [space] pressed?> then
if <touching [ground sprite] ?> then

end


repeat (20)

change x by (5)
end

end

end
adynlavine
Scratcher
39 posts

How do you make a sprite jump? cause it doesnt come back down if i just make it press the up button.

the repeat 20 is supposed to be inside the if touching ground sprite also the numbers are customizable

Powered by DjangoBB