Here's my code:
`********** Define global variables **********
GLOBAL x AS INTEGER
GLOBAL y AS INTEGER
GLOBAL xscreensize AS INTEGER
GLOBAL yscreensize AS INTEGER
GLOBAL Black AS INTEGER
GLOBAL Orange AS INTEGER
x = 0
y = 0
xscreensize = 1024
yscreensize = 768
Black = RGB(0, 0, 0)
Orange = RGB(255, 128, 0)
`Define the mapsize
DIM map(55, 55)
`********** Load required data **********
`Load the tile number 1 image
LOAD IMAGE "metal.bmp", 1, 1
`LOAD IMAGE "splodge.bmp", 1, 1
`********** Initialization **********
SET DISPLAY MODE xscreensize, yscreensize, 16
SET WINDOW ON
SYNC ON
SYNC RATE 0
`Define a temp map - all tiles are 1
FOR i = 0 to 54
FOR j = 0 to 54
map(i, j) = 1
NEXT j
NEXT i
`******************** Main Loop ********************
DO
CLS 0
`Draw the map
FOR i = 0 to 54
FOR j = 0 to 54
PASTE IMAGE map(i, j), x + (i * 32 - j * 32), y + ((j * 32) + (i * 16)) - j * 16, 1
NEXT j
NEXT i
`Check for map scrolling
IF LEFTKEY() THEN INC x,5
IF RIGHTKEY() THEN DEC x,5
IF DOWNKEY() THEN DEC y,5
IF UPKEY() THEN INC y,5
PRINT SCREEN FPS()
`Draw a black box around the map
`Draw right bar
BOX INT(xscreensize*0.975), 0, xscreensize, yscreensize, Orange, Orange, Orange, Orange
`Draw left bar
BOX 0, 0, INT(xscreensize*0.025), yscreensize, Orange, Orange, Orange, Orange
`Draw bottom bar
BOX 0, yscreensize, xscreensize, INT(yscreensize*0.85), Orange, Orange, Orange, Orange
`Draw top bar
BOX 0, 0, xscreensize, INT(yscreensize*0.05), Orange, Orange, Orange, Orange
SYNC
LOOP
`******************** End of Main Loop ********************
All was working fine until I changed the name of the image I am trying to load. I changed the name in the code, deleted the old image that was in the project folder and added the new one. However, I keep getting a runtime error saying that it cannot load image at line 41. Line 41 is this one:
PASTE IMAGE map(i, j), x + (i * 32 - j * 32), y + ((j * 32) + (i * 16)) - j * 16, 1
You can get the "metal.bmp" image by clicking below:
http://www.tinywars.dsl.pipex.com/images/metal.bmp
and the "splodge.bmp" image here:
http://www.tinywars.dsl.pipex.com/images/splodge.bmp
Of course, you only need one of them to test the code
Everything was working fine now its all screwed up! I don't know what I have done as I can't see any flaws with the code. Can someone help me out?