<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 ))
Offline
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
Offline
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. ENJOY!
Offline
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
Offline