This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2008-02-01 23:37:31

thething12321
Scratcher
Registered: 2007-12-12
Posts: 6

OMG! smooth jumping...

Oi I need a good way of making smooth jumping in my game
HELP!! ANYONE!

Offline

 

#2 2008-02-01 23:41:11

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: OMG! smooth jumping...

Check out this project.
http://scratch.mit.edu/projects/archmage/72848

I think you may find it helpful  smile


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#3 2008-02-02 00:17:19

thething12321
Scratcher
Registered: 2007-12-12
Posts: 6

Re: OMG! smooth jumping...

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

 

#4 2008-02-02 00:31:32

thething12321
Scratcher
Registered: 2007-12-12
Posts: 6

Re: OMG! smooth jumping...

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

 

#5 2008-02-02 07:38:01

Llamalover
Scratcher
Registered: 2007-05-18
Posts: 100+

Re: OMG! smooth jumping...

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>


Be nice, I'm an old lady  wink

Offline

 

#6 2008-02-02 11:09:30

Mayhem
Scratcher
Registered: 2007-05-26
Posts: 1000+

Re: OMG! smooth jumping...

I think my "complex jumping demo" has some quite smooth jumping.


Web-spinning Spider:  http://scratch.mit.edu/projects/Mayhem/18456
3D Dungeon Adventure:  http://scratch.mit.edu/projects/Mayhem/23570
Starfighter X: http://scratch.mit.edu/projects/Mayhem/21825
Wandering Knight: http://scratch.mit.edu/projects/Mayhem/28484

Offline

 

#7 2008-02-02 23:34:13

EdnaC
Scratcher
Registered: 2007-08-28
Posts: 100+

Re: OMG! smooth jumping...

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

 

Board footer