For horizontal movement:
when (green flag) clicked
forever
if <key [left arrow] pressed>
change xvelocity by -0.5
if <key [right arrow] pressed>
change xvelocity by 0.5
change x by xvelocity
Hope that helps
Last edited by coolstuff (2008-11-11 16:52:06)
Offline
there are plenty of velocities, here are the 2 most important:
moving technique:
forever
if <key[left arrow]pressed?>
change Xspeed by (-0.2)
if <key[right arrow]pressed?>
change Xspeed by (0.2)
if < <not<key[right arrow]pressed?> > or <not<key[left arrow]pressed?> > >
set Xspeed to ( (Xspeed) * (0.9) )
change X by Xspeed
jumping technique:
forever
if <key[up arrow]pressed?>
set Yspeed to (5)
change Y by (Yspeed)
repeat until <touching color [ground color]>
change Y by Yspeed
change Yspeed by (-0.2)
set Yspeed to (0)
Offline