50 value sx 60 value sy 0 value out 0 value hit?
: square ( -- )
\ define a square block for sprite pattern #0
data 4 $ffff $ffff $ffff $ffff 256 dchar ;
: ds ( -- )
\ display sprites
2 magnify
0 50 50 0 3 sprite
1 50 60 0 6 sprite ;
: movespr ( -- )
\ use joystick to move sprites. Fire to exit.
1 gmode square ds
false to out
begin
0 joyst case
1 of true to out endof
2 of -1 +to sx endof
4 of 1 +to sx endof
8 of 1 +to sy endof
16 of -1 +to sy endof
endcase
1 sy sx sprloc
8 0 1 coinc dup hit? = if
\ collision state hasn't changed. don't update display
drop
else
\ collision state has changed; update display
dup to hit?
0 0 gotoxy .
then
out until ;
|