when [up v] key pressed go up [some] wait[a bit] go down [some]by the scripts workshop
Last edited by dvd4 (2012-09-28 18:59:00)
Offline
"Jumping" is very vague. The complexity of the script will depend on what exactly you want it to do. The Scratch wiki should be able to help:
http://wiki.scratch.mit.edu/wiki/Jumping
Offline
when [up arrow v] key pressed repeat (10) change y by (10) end wait (1)secs//or any amt. of secs repeat (10) change y by (-10) endif you want to add velocity, put it afer the change y by block.(in the repeat still.
Last edited by gfchll (2012-09-28 18:20:05)
Offline
gfchll wrote:
when [up arrow v] key pressed repeat (10) change y by (10) end repeat (10) change y by (-10) endif you want to add velocity, put it afer the change y by block.(in the repeat still.
Fixed
Offline
jaxoncava wrote:
when [space v] key pressed change y by (50) wait (0.5) secs change y by (-50)this is a simple jumping script
Fixed.
Last edited by ErnieParke (2012-12-13 20:23:52)
Offline
ErnieParke wrote:
jaxoncava wrote:
when [space v] key pressed change y by (50) wait (0.5) secs change y by (-50)this is a simple jumping scriptFixed.
No, you changed the script.
Because of the delay scratch has, doing this
when [space v] key pressed change y by (50) wait (0.5) secs change y by (-50)will have the sprite suddenly go up 50 pixels, then suddenly go down 50 pixels. But, if you do this
when [space v] key pressed repeat (10) change y by (5) end wait (0) secs //change repeat (10) change y by (-5) endbecause of scratch's built in wait time, it will actually show it (sort-of) glide up 50 pixels, then glide down 50 pixels. Instead of just appearing higher, then going back.
Last edited by TorbyFork234 (2012-12-13 20:37:19)
Offline
TorbyFork234 wrote:
ErnieParke wrote:
jaxoncava wrote:
when [space v] key pressed change y by (50) wait (0.5) secs change y by (-50)this is a simple jumping scriptFixed.
No, you changed the script.
When I had said "fixed", I had meant that I had fixed the scratchblocks code itself so that the scratch blocks were displayed correctly; nothing more. I hope that this clears things up.
Offline
when gf clicked repeat (10) change y by (10) end repeat (10) change y by (-10)Go ahead and try this because I know it works.
Last edited by maxamillion321 (2012-12-19 21:46:32)
Offline
IMO the best way to jump is to use a little bit of magic (trig).
set [base_y v] to (y position) set [jpos v] to [0] repeat (45) change [jpos v] by (4) set y to ((base_y) + (([sin v] of (jpos)) * (jump height))) end
Offline
maxamillion321 wrote:
when gf clicked repeat (10) change y by (5) end repeat untill (touching ground v) change y by (-5) endGo ahead and try this because I know it works.
Fixed. Made it so the character falls no matter how high or low the ground is.
Edit can anybody tell me how to make the repeat untill wrap around the change Y block?
Last edited by fillergames (2012-12-20 05:17:38)
Offline
fillergames wrote:
maxamillion321 wrote:
when gf clicked repeat (10) change y by (5) end repeat untill (touching ground v) change y by (-5) endGo ahead and try this because I know it works.Fixed. Made it so the character falls no matter how high or low the ground is.
I just realized that that is also wrong with my script
Offline
Gravitation wrote:
fillergames wrote:
maxamillion321 wrote:
when gf clicked repeat (10) change y by (5) end repeat untill (touching ground v) change y by (-5) endGo ahead and try this because I know it works.Fixed. Made it so the character falls no matter how high or low the ground is.
I just realized that that is also wrong with my script
I can't get the repeat untill block to wrap around the change Y block. Its annoying.
Offline
fillergames wrote:
Gravitation wrote:
fillergames wrote:
Fixed. Made it so the character falls no matter how high or low the ground is.
I just realized that that is also wrong with my script
I can't get the repeat untill block to wrap around the change Y block. Its annoying.
Fixed
when gf clicked repeat (10) change y by (5) end repeat until<touching [ground v]?> change y by (-5) end
Offline
fillergames wrote:
maxamillion321 wrote:
when gf clicked repeat (10) change y by (5) end repeat untill (touching ground v) change y by (-5) endGo ahead and try this because I know it works.Fixed. Made it so the character falls no matter how high or low the ground is.
Edit can anybody tell me how to make the repeat untill wrap around the change Y block?
For one thing, you're spelling until wrong. This should work:
repeat until <touching [ground v]?> change y by (-5) end
Offline
CanadianGeorge wrote:
fillergames wrote:
maxamillion321 wrote:
when gf clicked repeat (10) change y by (5) end repeat until <touching? [ground v]> change y by (-5) endGo ahead and try this because I know it works.Fixed. Made it so the character falls no matter how high or low the ground is.
Edit can anybody tell me how to make the repeat untill wrap around the change Y block?For one thing, you're spelling until wrong. This should work:
repeat until <touching [ground v]?> change y by (-5) end
Thanks for the help!
Last edited by cheddargirl (2012-12-21 01:59:41)
Offline