here is a list of tips and tricks that will help you in scratch. if you know any others please tell me. it will start small.
if you want to make a good jumper do this
when [up arrow v] key pressed reapeat (10) times change x by (5) end
Offline
RoboNeo9 wrote:
here is a list of tips and tricks that will help you in scratch. if you know any others please tell me. it will start small.
if you want to make a good jumper do thiswhen [up arrow v] key pressed repeat (10) times change x by (5) end
Um... that will only make it go up...
Offline
RoboNeo9 wrote:
here is a list of tips and tricks that will help you in scratch. if you know any others please tell me. it will start small.
if you want to make a good jumper do thiswhen [up arrow v] key pressed if <touching [ground v]?> repeat (10) change y by (5) wait (0.03) secs end repeat (10) change y by (-5) wait (0.03) secs end end
I edited your script to make it better. Anyway, nice tip!
Last edited by ErnieParke (2012-09-23 19:47:22)
Offline
when gf clicked set [gravity v] to (-.4) set [velocity v] to (0) forever if <touching [ground v]?> set [velocity v] to (0) else change [velocity v] by (gravity) change y by (velocity)
when gf clicked forever if <key [space v] pressed?> if <(yvelocity) = (0)> set [jumping v] to (1) repeat (10) change [yvelocity v] by <(gravity) * (-1.4)> end set [jumping v] to (0)
Offline
bullelk12 wrote:
when gf clicked set [gravity v] to (-.4) set [velocity v] to (0) forever if <touching [ground v]?> set [velocity v] to (0) else change [velocity v] by (gravity) change y by (velocity)when gf clicked forever if <key [space v] pressed?> if <(yvelocity) = (0)> set [jumping v] to (1) repeat (10) change [yvelocity v] by <(gravity) * (-1.4)> end set [jumping v] to (0)
The other one is better for new scratchers though.
Offline
RoboNeo9 wrote:
here is a list of tips and tricks that will help you in scratch. if you know any others please tell me. it will start small.
if you want to make a good jumper do thiswhen [up arrow v] key pressed repeat (10) change x by (5) end
Fixed.
And that will only make it go up-- no, wait, it would go sideways! You're getting X and Y confused.
Here is a better jumping script (if you're trying to make a game.):
when gf clicked set [yv v] to (0) forever if <key [up arrow v] pressed?> if <touching [ground v]?> repeat (20)//At least I think it should be 20... change [yv v] by (0.5)//I think it's 0.5... end set [yv v] to (0)//Added, so it can go down. Satisfied? repeat (20) change [yv v] by (-0.5) end set [yv v] to (0)//NOW is it okay???? end end end end When gf clicked forever change y by (yv)EDIT:There. Now it's a better script (and it does change y position now!) I was going to put the "forever change y by yv", but I forgot.
Last edited by awesomeness321 (2012-09-25 20:07:25)
Offline
awesomeness321 wrote:
RoboNeo9 wrote:
here is a list of tips and tricks that will help you in scratch. if you know any others please tell me. it will start small.
if you want to make a good jumper do thiswhen [up arrow v] key pressed repeat (10) change x by (5) endFixed.
And that will only make it go up-- no, wait, it would go sideways! You're getting X and Y confused.
Here is a better jumping script (if you're trying to make a game.):when gf clicked forever if <key [up arrow v] pressed?> if <touching [ground v]?> repeat (20)//At least I think it should be 20... change [yv v] by (0.5)//I think it's 0.5... end repeat (20) change [yv v] by (-0.5) end end end
That will make the object accelerate up for a bit, then accelerate down, then no acceleration. Basically, you moved the object up.
Last edited by Molybdenum (2012-09-23 19:35:39)
Offline
Molybdenum wrote:
awesomeness321 wrote:
RoboNeo9 wrote:
here is a list of tips and tricks that will help you in scratch. if you know any others please tell me. it will start small.
if you want to make a good jumper do thiswhen [up arrow v] key pressed repeat (10) change x by (5) endFixed.
And that will only make it go up-- no, wait, it would go sideways! You're getting X and Y confused.
Here is a better jumping script (if you're trying to make a game.):when gf clicked forever if <key [up arrow v] pressed?> if <touching [ground v]?> repeat (20)//At least I think it should be 20... change [yv v] by (0.5)//I think it's 0.5... end repeat (20) change [yv v] by (-0.5) end end endThat will make the object accelerate up for a bit, then accelerate down, then no acceleration. Basically, you moved the object up.
No. He's just changing a variable and not the y position
Offline
zubblewu wrote:
Molybdenum wrote:
awesomeness321 wrote:
Fixed.
And that will only make it go up-- no, wait, it would go sideways! You're getting X and Y confused.
Here is a better jumping script (if you're trying to make a game.):when gf clicked forever if <key [up arrow v] pressed?> if <touching [ground v]?> repeat (20)//At least I think it should be 20... change [yv v] by (0.5)//I think it's 0.5... end repeat (20) change [yv v] by (-0.5) end end endThat will make the object accelerate up for a bit, then accelerate down, then no acceleration. Basically, you moved the object up.
No. He's just changing a variable and not the y position
Good point.
Offline
Molybdenum wrote:
zubblewu wrote:
Molybdenum wrote:
That will make the object accelerate up for a bit, then accelerate down, then no acceleration. Basically, you moved the object up.No. He's just changing a variable and not the y position
Good point.
Okay, I fixed it.
Offline
awesomeness321 wrote:
RoboNeo9 wrote:
here is a list of tips and tricks that will help you in scratch. if you know any others please tell me. it will start small.
if you want to make a good jumper do thiswhen [up arrow v] key pressed repeat (10) change x by (5) endFixed.
And that will only make it go up-- no, wait, it would go sideways! You're getting X and Y confused.
Here is a better jumping script (if you're trying to make a game.):when gf clicked forever if <key [up arrow v] pressed?> if <touching [ground v]?> repeat (20)//At least I think it should be 20... change [yv v] by (0.5)//I think it's 0.5... end repeat (20) change [yv v] by (-0.5) end end end end end When gf clicked forever change y by (yv)EDIT:There. Now it's a better script (and it does change y position now!) I was going to put the "forever change y by yv", but I forgot.
I just wanted to point out that your script will only move a sprite upwards, and not back down. Other than that, nice script!
Last edited by ErnieParke (2012-09-24 18:23:02)
Offline
ErnieParke wrote:
awesomeness321 wrote:
RoboNeo9 wrote:
here is a list of tips and tricks that will help you in scratch. if you know any others please tell me. it will start small.
if you want to make a good jumper do thiswhen [up arrow v] key pressed repeat (10) change x by (5) endFixed.
And that will only make it go up-- no, wait, it would go sideways! You're getting X and Y confused.
Here is a better jumping script (if you're trying to make a game.):when gf clicked forever if <key [up arrow v] pressed?> if <touching [ground v]?> repeat (20)//At least I think it should be 20... change [yv v] by (0.5)//I think it's 0.5... end repeat (20)//Did you notice this part, ErnieParke? change [yv v] by (-0.5) end end end end end When gf clicked forever change y by (yv)EDIT:There. Now it's a better script (and it does change y position now!) I was going to put the "forever change y by yv", but I forgot.I just wanted to point out that your script will only move a sprite upwards, and not back down. Other than that, nice script!
Actually, it makes it go up by 0.5 20 times, then it goes down an equal amount the same number of times.
Offline
awesomeness321 wrote:
ErnieParke wrote:
awesomeness321 wrote:
Fixed.
And that will only make it go up-- no, wait, it would go sideways! You're getting X and Y confused.
Here is a better jumping script (if you're trying to make a game.):when gf clicked forever if <key [up arrow v] pressed?> if <touching [ground v]?> repeat (20)//At least I think it should be 20... change [yv v] by (0.5)//I think it's 0.5... end repeat (20)//Did you notice this part, ErnieParke? change [yv v] by (-0.5)//Yes, I had. end end end end end When gf clicked forever change y by (yv)EDIT:There. Now it's a better script (and it does change y position now!) I was going to put the "forever change y by yv", but I forgot.I just wanted to point out that your script will only move a sprite upwards, and not back down. Other than that, nice script!
Actually, it makes it go up by 0.5 20 times, then it goes down an equal amount the same number of times.
No it doesn't. Your scripts increase yv to 10, then it decrease yv to 0 and yv never goes negative, so I don't see how you get the sprite to move down if yv never goes negative.
Last edited by ErnieParke (2012-09-24 20:36:54)
Offline
ErnieParke wrote:
awesomeness321 wrote:
ErnieParke wrote:
I just wanted to point out that your script will only move a sprite upwards, and not back down. Other than that, nice script!Actually, it makes it go up by 0.5 20 times, then it goes down an equal amount the same number of times.
No it doesn't. Your scripts increase yv to 10, then it decrease yv to 0 and yv never goes negative, so I don't see how you get the sprite to move down if yv never goes negative.
Yes. Its basic (integration) calculus.
Offline
ErnieParke wrote:
awesomeness321 wrote:
ErnieParke wrote:
I just wanted to point out that your script will only move a sprite upwards, and not back down. Other than that, nice script!
Actually, it makes it go up by 0.5 20 times, then it goes down an equal amount the same number of times.
No it doesn't. Your scripts increase yv to 10, then it decrease yv to 0 and yv never goes negative, so I don't see how you get the sprite to move down if yv never goes negative.
Ok, wait, let me fix that...
Offline
awesomeness321 wrote:
RoboNeo9 wrote:
here is a list of tips and tricks that will help you in scratch. if you know any others please tell me. it will start small.
if you want to make a good jumper do thiswhen [up arrow v] key pressed repeat (10) change x by (5) endFixed.
And that will only make it go up-- no, wait, it would go sideways! You're getting X and Y confused.
Here is a better jumping script (if you're trying to make a game.):when gf clicked set [yv v] to (0) forever if <key [up arrow v] pressed?> if <touching [ground v]?> repeat (20)//At least I think it should be 20... change [yv v] by (0.5)//I think it's 0.5... end set [yv v] to (0)//Added, so it can go down. Satisfied? repeat (20)//Almost. change [yv v] by (-0.5) end end end end end When gf clicked forever change y by (yv)EDIT:There. Now it's a better script (and it does change y position now!) I was going to put the "forever change y by yv", but I forgot.
I just saw another flaw. After jumping once, yv gets set to -10 and never gets reset to 0, so your sprite will float downwards for the rest of its life, which is a very sad situation. Falling forever doesn't sound very appeasing.
Last edited by ErnieParke (2012-09-25 19:05:05)
Offline