DIM screenmem%
(22, 12), kbd
(255), keystate
(255)
'Why complicate the following with hard to understand math, when a much simpler method exists which is way easier to understand?
keystate(k) = 1 'keystate(k) = -((k AND 128) = 0)
score = 0
screenmem%(mx%, my%) = 1
k
= INP(&H60): kbd
(k
AND 127) = keystate
(k
) xv = kbd(77) - kbd(75)
yv = kbd(80) - kbd(72)
screenmem%(mx%, my%) = 32
IF xv
= -1 AND screenmem%
(mx%
- 1, my%
) = 32 THEN mx%
= mx%
- 1 IF xv
= 1 AND screenmem%
(mx%
+ 1, my%
) = 32 THEN mx%
= mx%
+ 1 IF yv
= -1 AND screenmem%
(mx%
, my%
- 1) = 32 THEN my%
= my%
- 1 IF yv
= 1 AND screenmem%
(mx%
, my%
+ 1) = 32 THEN my%
= my%
+ 1 IF xv
= -1 AND screenmem%
(mx%
- 1, my%
) = 176 THEN mx%
= mx%
- 1:
GOTO skp
IF xv
= 1 AND screenmem%
(mx%
+ 1, my%
) = 176 THEN mx%
= mx%
+ 1:
GOTO skp
IF yv
= -1 AND screenmem%
(mx%
, my%
- 1) = 176 THEN my%
= my%
- 1:
GOTO skp
IF yv
= 1 AND screenmem%
(mx%
, my%
+ 1) = 176 THEN my%
= my%
+ 1:
GOTO skp
IF xv
= -1 AND screenmem%
(mx%
- 1, my%
) = 79 AND screenmem%
(mx%
- 2, my%
) = 32 THEN screenmem%
(mx%
- 2, my%
) = 79: screenmem%
(mx%
- 1, my%
) = 32: mx%
= mx%
- 1 IF xv
= 1 AND screenmem%
(mx%
+ 1, my%
) = 79 AND screenmem%
(mx%
+ 2, my%
) = 32 THEN screenmem%
(mx%
+ 2, my%
) = 79: screenmem%
(mx%
+ 1, my%
) = 32: mx%
= mx%
+ 1 IF xv
= -1 AND screenmem%
(mx%
- 1, my%
) = 4 THEN mx%
= mx%
- 1: score
= score
+ 1 IF xv
= 1 AND screenmem%
(mx%
+ 1, my%
) = 4 THEN mx%
= mx%
+ 1: score
= score
+ 1 IF yv
= 1 AND screenmem%
(mx%
, my%
+ 1) = 4 THEN my%
= my%
+ 1: score
= score
+ 1 skp:
animate:
IF screenmem%
(i
, j
) = 79 AND screenmem%
(i
, j
+ 1) = 32 THEN screenmem%
(i
, j
) = 32: screenmem%
(i
, j
+ 1) = 79 IF screenmem%
(i
, j
) = 4 AND screenmem%
(i
, j
+ 1) = 32 THEN screenmem%
(i
, j
) = 32: screenmem%
(i
, j
+ 1) = 4
displaymap:
b = screenmem%(j, i)
readlev:
IF screenmem
(j
, i
) = 1 THEN mx%
= j: my%
= i
DATA 177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177 DATA 177,79,79,4,177,234,32,32,32,32,32,32,32,177,79,4,79,4,79,177 DATA 177,176,176,176,177,177,176,176,176,32,79,79,32,177,176,79,79,79,176,177 DATA 177,176,177,177,177,176,176,79,176,32,176,176,32,177,176,176,176,176,176,177 DATA 177,176,176,176,176,176,79,176,79,32,32,32,32,32,32,32,176,79,176,177 DATA 177,176,79,176,79,176,177,4,177,1,177,177,177,177,177,32,176,176,176,219 DATA 177,79,176,176,176,176,177,177,177,32,177,79,4,79,177,32,79,176,176,177 DATA 177,176,176,176,176,176,176,176,177,32,177,4,79,4,177,32,176,79,79,177 DATA 177,176,176,79,176,79,176,176,177,32,177,177,79,177,177,32,176,176,176,177 DATA 177,176,79,176,79,176,79,176,177,32,176,176,176,176,176,32,176,79,176,177 DATA 177,176,79,4,176,4,79,176,177,32,32,32,235,32,32,32,176,79,4,177 DATA 177,177,177,177,177,177,177,177,177,177,219,177,177,177,177,177,177,177,177,177
'The above DATA statements correspond directly to the ASCII values of each spot on the grid below
'DATA "±±±±±±±±±±±±±±±±±±±±"
'DATA "±OO±ê ±OOO±"
'DATA "±°°°±±°°° OO ±°OOO°±"
'DATA "±°±±±°°O° °° ±°°°°°±"
'DATA "±°°°°°O°O °O°±"
'DATA "±°O°O°±±±±±±± °°°Û"
'DATA "±O°°°°±±± ±OO± O°°±"
'DATA "±°°°°°°°± ±O± °OO±"
'DATA "±°°O°O°°± ±±O±± °°°±"
'DATA "±°O°O°O°± °°°°° °O°±"
'DATA "±°O°O°± ë °O±"
'DATA "±±±±±±±±±±Û±±±±±±±±±"