I don't know why, but whenever I run this code with DBC it only shows the image I loaded and freezes.
Level = 1
maxlevels = 1
largestmap = 64
Dim Mapsize(maxlevels)
Mapsize(1) = 64
Dim Map$(largestmap,largestmap,2)
playerx = 0
playery = 0
Load image "Playerdown.bmp",1
Load image "Floor.bmp",2
Load image "Wall.bmp",3
Load image "door.bmp",4
Load image "Locked door.bmp",5
Load image "open door.bmp",6
Load image "key.bmp",7
Start:
set cursor 100,100
print "1"
gosub Loadmap
end
`****SUBPROGRAM: LOAD MAP ************
Loadmap:
filename$ = "level" + str$(level) + ".bmp"
Load image filename$,100
Paste image 100,1,1
Print "2"
For y = 1 to mapsize(level)
For x = 1 to mapsize(level)
If point(x,y) = rgb(128,128,128) then map$(x,y,1) = "wall"
If point(x,y) = rgb(192,192,192) then Map$(x,y,1) = "floor"
If point(x,y) = rgb(255,255,0) then map$(x,y,1) = "door"
If point(x,y) = rgb(255,128,0) then map$(x,y,1) = "lock"
If point(x,y) = rgb(255,0,0) then map$(x,y,1) = "key"
If point(x,y) = rgb(0,255,255) then map$(x,y,1) = "up"
If point(x,y) = rgb(255,255,255)
playerx = x
playery = y
map$(x,y,1) = "floor"
endif
Next x
next y
Print "3"
delete image 100
cls
return
I'm trying to load a map and use the pixels in it to make an array for the map of the game, but it isn't working. Please Help!
Green Bunnies rule!