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

#1 2008-06-17 14:25:40

AlexJ
Scratcher
Registered: 2008-06-11
Posts: 6

Exellent Movement!

<set{ yvelocity }to( 0<set{ xvelocity }to( 0<set{ maxspeed }to( 20<when green flag clicked><forever><if><< <key[ right arrow ]pressed?> <and> <( <abs( <{ xvelocity }> <<> <{ maxspeed }> )> >><change{ xvelocity }by( 2<if><< <touching color[ (choose) <or> <touching[ (choose) >><set{ yvelocity }to( 1<if><< <key[ up arrow ]pressed?> <or> <key[ space ]pressed?> >><change{ yvelocity }by( 15<change{ yvelocity }by( -1<change y by( yvelocity<change x by( xvelocity<set{ xvelocity }to( (( 0.9 <*> xvelocity ))


Like Racing Games?   \/   What's your time?
http://scratch.mit.edu/projects/AlexJ/189373

Offline

 

#2 2008-06-17 14:32:01

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: Exellent Movement!

AlexJ wrote:

[blocks]<set{ yvelocity }to( 0[/blocks]
[blocks]<set{ xvelocity }to( 0[/blocks]
[blocks]<set{ maxspeed }to( 20[/blocks]
[blocks]<when green flag clicked>[/blocks]
[blocks]<forever>[/blocks]
[blocks]<if><< <key[ right arrow ]pressed?> <and> <( <abs( <{ xvelocity }> <<> <{ maxspeed }>>>[/blocks]
[blocks]<change{ xvelocity }by( 2[/blocks]
[blocks]<if><< <touching color[ (choose) <or> <touching[ (choose) >>[/blocks]
[blocks]<set{ yvelocity }to( 1[/blocks]
[blocks]<if><< <key[ up arrow ]pressed?> <or> <key[ space ]pressed?> >>[/blocks]
[blocks]<change{ yvelocity }by( 15[/blocks]
[blocks]<change{ yvelocity }by( -1[/blocks]
[blocks]<change y by( yvelocity[/blocks]
[blocks]<change x by( xvelocity[/blocks]
[blocks]<set{ xvelocity }to( (( 0.9 <*> xvelocity ))[/blocks]

Now it's stacked I think


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

#3 2008-06-17 14:33:18

AlexJ
Scratcher
Registered: 2008-06-11
Posts: 6

Re: Exellent Movement!

If you didnt understand that then I will type it all in normally:
when green flag clicked set y velocity to 0 set x velocity to 0 set maxspeed to 20 forever if key right arrow pressed and abs of xvelocity under maxspeed change xvelocity by 2 (do the same with left arrow key except with -2) take out another if block - if touching colour (choose) or touching (choose ( you choose wether you want touching a colour or touching a sprite)) set yvelocity to 1 if (inside of the other if block just after the set yvelocity to 1) key up arrow pressed or key space pressed (this means you get to choose wether you want to make him jump when you press space or the up arrow key) change y velocity to 15 (personally 15 is the best number) next inside the forever block after all of those scripts add these - change y by yvelocity change x by x velocity set x to 0.9 star x velocity change yvelocity by -1.

That is the entire scripts.  smile  ENJOY!


Like Racing Games?   \/   What's your time?
http://scratch.mit.edu/projects/AlexJ/189373

Offline

 

#4 2008-06-17 14:35:51

AlexJ
Scratcher
Registered: 2008-06-11
Posts: 6

Re: Exellent Movement!

AlexJ wrote:

<set{ yvelocity }to( 0<set{ xvelocity }to( 0<set{ maxspeed }to( 20<when green flag clicked><forever><if><< <key[ right arrow ]pressed?> <and> <( <abs( <{ xvelocity }> <<> <{ maxspeed }> )> >><change{ xvelocity }by( 2<if><< <touching color[ (choose) <or> <touching[ (choose) >><set{ yvelocity }to( 1<if><< <key[ up arrow ]pressed?> <or> <key[ space ]pressed?> >><change{ yvelocity }by( 15<change{ yvelocity }by( -1<change y by( yvelocity<change x by( xvelocity<set{ xvelocity }to( (( 0.9 <*> xvelocity ))

the green flag was meant to go before the variables at the start


Like Racing Games?   \/   What's your time?
http://scratch.mit.edu/projects/AlexJ/189373

Offline

 

Board footer