Oi I need a good way of making smooth jumping in my game
HELP!! ANYONE!
Offline
Check out this project.
http://scratch.mit.edu/projects/archmage/72848
I think you may find it helpful
Offline
there is this block I don't have because it's in te newest version of scratch...
I can't find the version on the internet. Oh well, gotta find a nother way
Offline
hmm... here's a good one I just made...
first you make a smooth gravity, and then along with that make
<when green flag clicked>
<forever if><key[ up arrow ]pressed?>
<repeat( 10
<change y by( 10
<end>
<repeat( 10
<change y by( 8
<end>
<repeat( 10
<change y by( 5
<end>
<repeat( 10
<change y by( -2
<end>
<end>
TAADAAA!!
Offline
Almost. it would be more like:
[blocks]
<when[ up ]key pressed>
<repeat( 10
<change y by( 4
<end>
<repeat( 20
<change y by( 2
<end>
<repeat( 20
<change y by( 1
<end>
<wait( .15 )secsc>
<repeat( 20
<change y by( -1
<end>
<repeat( 20
<change y by( -2
<end>
<repeat( 10
<change y by( -4
<end>
<end>
Offline
I think my "complex jumping demo" has some quite smooth jumping.
Offline
All of the "repeat" and the different "change y by" blocks are really just (sorta complicated) substitutes for using a variable to represent gravity. Archmage's project, along with several other implementations of "gravity" can be found in:
http://scratch.mit.edu/galleries/view/9206
Mayhem's project ( http://scratch.mit.edu/projects/Mayhem/26609 ) is another interesting approach; It uses a "sensor" sprite that is almost invisible (using the "ghost effect" in "Looks") to find out what the visible sprite is touching. In that project, gravity is represented by a variable called "jump".
Variables are a powerful tool that you can use as your projects become more advanced (like jumping, bouncing, or shooting a realistic looking "projectile").
-MrEd
Offline