--- this part moves a sprite based on what arrow key a person has typed -- the subroutine 'keyhandlerarrow' checks for which arrow is pressed -- the example moves sprite 4 based on the arrows -- the case part is a more elegant way of calling subroutines based on arrow -- you would have to write the routines 'turnleft' etc -- you would attach this to a frame script in the score on keyDown keyhandlerarrow end on keyhandlerarrow if (the keycode) = 123 then -- rightarrow sprite(4).loch = sprite(4).loch+1 end if if (the keycode) = 124 then -- leftarrow sprite(4).loch = sprite(4).loch-1 end if if (the keycode) = 125 then -- uparrow sprite(4).locv = sprite(4).locv-1 end if if (the keycode) = 126 then -- downarrow sprite(4).locv = sprite(4).locv+1 end if -- -- case (the keyCode) of -- 123: TurnLeft -- 126: GoForward -- 125: BackUp -- 124: TurnRight -- end case end