okay- i have another problem.
i'm using sprites that i made in PP256, but when i load them, it loads the black area around the sprite, so they destroy the background when they move around. i'm trying to get just the area that's not black to load.
also, when i run this, it is now giving me a subscript out of range, hilighting the redim array(memsize) line in the loadput sub
Code:
' ///Sub Declarations\\\
DECLARE SUB LoadPUT (File$, array%())
DECLARE SUB init ()
DEFINT A-Z 'what is this?
'$DYNAMIC 'some variables!
DIM squid(0)
DIM SHARED BG1(0)
DIM SHARED BG2(0)
DIM SHARED xcoor(9)
DIM SHARED ycoor(9)
DIM SHARED bmap(9, 9)
DIM SHARED grx, gry
SCREEN 13
LoadPUT "SQUID.put", squid()
LoadPUT "BG1.put", BG1()
LoadPUT "BG2.put", BG2()
CLS
CALL init
xpos = 1
ypos = 1
grx = 1
gry = 1
DO
PUT (xpos, ypos), squid, PRESET
inky = VAL(INKEY$)
IF inky = 6 THEN
IF xpos <= 257 THEN xpos = xpos + 32: grx = grx + 1
END IF
IF inky = 4 THEN
IF xpos >= 33 THEN xpos = xpos - 32: grx = grx - 1
END IF
IF inky = 8 THEN
IF ypos >= 21 THEN ypos = ypos - 20: gry = gry - 1
END IF
IF inky = 2 THEN
IF ypos < 181 THEN ypos = ypos + 20: gry = gry + 1
END IF
'put code here later for redrawing the background.
'right now, the picture isn't even erased. not my main worry right
'now though. the program won't even run, i wonder what i
'deleted.
LOOP UNTIL inky = 5
DATA 1,1,1,1,1,2,1,1,1,1
DATA 1,1,2,1,1,1,1,1,2,1
DATA 1,1,1,2,1,2,1,1,1,1
DATA 1,2,1,1,2,1,1,1,1,1
DATA 1,1,2,1,1,1,1,2,1,1
DATA 1,1,1,1,1,2,1,1,1,1
DATA 1,2,1,2,1,1,2,1,1,1
DATA 1,1,1,1,2,1,1,1,1,1
DATA 1,1,2,1,1,1,1,1,1,2
DATA 1,1,2,1,2,2,1,1,1,1
END
'SYSTEM
REM $STATIC
SUB init
xcoor(0) = 1
xcoor(1) = 33
xcoor(2) = 65
xcoor(3) = 97
xcoor(4) = 129
xcoor(5) = 161
xcoor(6) = 193
xcoor(7) = 225
xcoor(8) = 257
xcoor(9) = 289
ycoor(0) = 1
ycoor(1) = 21
ycoor(2) = 41
ycoor(3) = 61
ycoor(4) = 81
ycoor(5) = 101
ycoor(6) = 121
ycoor(7) = 141
ycoor(8) = 161
ycoor(9) = 181
FOR y = 0 TO 9
FOR x = 0 TO 9
READ bmap(x, y)
NEXT x
NEXT y
FOR y = 0 TO 9
FOR x = 0 TO 9
IF bmap(x, y) = 1 THEN
PUT (xcoor(x), ycoor(y)), BG1
END IF
IF bmap(x, y) = 2 THEN
PUT (xcoor(x), ycoor(y)), BG2
END IF
NEXT x
NEXT y
END SUB
SUB LoadPUT (File$, array())
f = FREEFILE
OPEN File$ FOR BINARY AS #1
memsize = (LOF(1) - 7) / 2 - 1
CLOSE #1
REDIM array(memsize)
DEF SEG = VARSEG(array(0))
BLOAD File$, VARPTR(array(0))
END SUB
also- what does DEFINT A-Z mean? maybe that's causing my problem, but i don't know what it even is.
thanks for the help.