07-24-2005, 08:43 PM
Can anyone tell me why this code isn't working. I press 'compile and run' and it gives me the following error "error 60: Illegal specification, at parameter 6: map On line: 26"
Thanks in advance.
Jack
Code:
SCREEN 17
CLS
DIM map%(1 TO 80, 1 TO 25)
FOR grassy% = 1 TO 24
FOR grassx% = 1 TO 80
map%(grassx%, grassy%) = 1
NEXT grassx%
NEXT grassy%
FOR x = 1 to 80
for y = 1 to 25
if map%(x, y) = 1 THEN
LOCATE y, x
COLOR 47, 0
PRINT CHR$(177)
end if
next y
next x
locx% = 1
locy% = 1
player$ = CHR$(2)
sub graphics(x as integer, y as integer, oldx as integer, oldy as integer, char as string, map(1 TO 80, 1 TO 25) AS integer)
CLS
map(x, y) = 0
LOCATE y, x
COLOR 31, 0
PRINT char
map%(oldx, oldy) = 1
end sub
DO
press$ = INKEY$
IF press$ = "s" THEN
oldy% = locy%
locy% = locy + 1
graphics locx%, locy%, oldx%, oldy%, player$, map%(1 TO 80, 1 TO 25)
ELSEIF press$ = "w" THEN
oldy% = locy%
locy% = locy% - 1
graphics locx%, locy%, oldx%, oldy%, player$, map%(1 TO 80, 1 TO 25)
ELSEIF press$ = "d" THEN
oldx% = locx%
locx% = locx% + 1
graphics locx%, locy%, oldx%, oldy%, player$, map%(1 TO 80, 1 TO 25)
ELSEIF press$ = "a" THEN
oldx% = locx%
locx% = locx% - 1
graphics locx%, locy%, oldx%, oldy%, player$, map%(1 TO 80, 1 TO 25)
END IF
FOR x = 1 to 80
for y = 1 to 25
if map%(x, y) = 1 THEN
LOCATE y, x
COLOR 47, 0
PRINT CHR$(177)
end if
next y
next x
IF press$ <> "" THEN
CLS
press$ = ""
END IF
LOOP UNTIL press$ = CHR$(27)
Thanks in advance.
Jack