Dang! It's the old "I forgot to turn off HTML problem"
I noticed everybody else has the same problem in this thread. When you post code, you must remember to turn HTML off or else the less-than-sign is interpreted as an attempt to give an HTML command to the browser. Many slip through as illegal and stay unchanged, but some, like this post, get messed up.
Actually, it wouldn't hurt for me to preview the code, but if I could remember that, I could remember to turn HTML off. LOL.
Anyway, here is the code again. Since I am posting again, I altered the code to keep the player on the screen.
Code tested.
Mac
Code: Select all
SCREEN 13
x = 50
y = 50
aix = 12
aiy = 15
DO
typed$ = INKEY$
IF typed$ = CHR$(27) THEN SYSTEM
WAIT &H3DA, 8
LINE (x - 8, y - 8)-(x + 8, y + 8), 0, BF
CIRCLE (x, y), 2
PAINT (x, y), 4, 15
IF typed$ = "w" THEN IF y > 3 THEN y = y - 1
IF typed$ = "s" THEN IF y < 197 THEN y = y + 1
IF typed$ = "d" THEN IF x < 315 THEN x = x + 1
IF typed$ = "a" THEN IF x > 2 THEN x = x - 1
WAIT &H3DA, 8
LINE (aix - 8, aiy - 8)-(aix + 8, aiy + 8), 0, BF
CIRCLE (aix, aiy), 2
PAINT (aix, aiy), 5, 15
IF aix > x THEN aix = aix - .1
IF aix < x THEN aix = aix + .1
IF aiy > y THEN aiy = aiy - .1
IF aiy < y THEN aiy = aiy + .1
LOOP