Simple sprite movement code (put this in the keydown [make sure you already initialized and created the sprite in card opening])
select case key$
CASE uparrow$
PUSHSPRITE 1,0,-10
CASE downarrow$
PUSHSPRITE 1,0,10
CASE leftarrow$
PUSHSPRITE 1,-10,0
CASE rightarrow$
PUSHSPRITE 1,10,0
END SELECT
Documentation for PUSHSPRITE:
PUSHSPRITE [sprite number], [x value], [y value], [optional boolean]
There is another way to do this, as you could use conditionals to test what key the user is pressing.
IF key$ = uparrow$ THEN
PUSHSPRITE 1,0,-10
END IF
IF key$ = downarrow$ THEN
PUSHSPRITE 1,0,10
END IF
IF key$ = leftarrow$ THEN
PUSHSPRITE 1,-10,0
END IF
IF key$ = rightarrow$ THEN
PUSHSPRITE 1,10,0
END IF
It's much more elegant to use a case select, but you don't need to worry about that... both methods accomplish the same thing
.
As for grid movement, take a look Equanox's examples.