Basic method:
Put this in the sprite that you want to move.
<when green flag clicked>
<forever>
<if><key[ left arrow ]pressed?>
<change x by( -3 )
<end>
<if><key[ right arrow ]pressed?>
<change x by( 3 )
<end>
<end>
Basic method2:
This gives a sprite a velocity effect
make a variable called "xvelocity"
<when green flag clicked>
<forever>
<set x to( <{ xvelocity }> )
<set{ x velocity }to( (( <{ xvelocity }> <*> .95 ))
<if><key[ right arrow ]pressed?>
<change{ xvelocity }by( .3 )
<end>
<if><key[ left arrow ]pressed?>
<change{ xvelocity }by( -.3 )
<end>
<end>
For a project demonstration here it is
Last edited by keroro645 (2008-08-24 16:35:41)
Offline
Nice tutorial and outcome.
Offline