Hello everyone Great Engine btw just got professional and im so excited. So i made a load map function taht loads the map. But when it loads the map it skips a couple of tiles.
Set Display Mode 800,600,32
Set Window Title "My DarkBasic Game"
MapSize = 10
dim map$(MapSize, MapSize)
loadmap("Media/map2.map", MapSize)
load image "Media/grass.png", 1
load image "Media/water.png", 2
tileWidth = 32
tileHeight = 32
MaxTiles = 25
for y=1 to MapSize
for x=1 to MapSize
if map$(x,y)="#"
id = id + 1
Sprite id,(x-1) * tileWidth, (y-1) * tileHeight,1
endif
next x
next y
do
sync
loop
function loadmap(filename$, size)
open to read 1, filename$
for y=1 to size
for x=1 to size
read byte 1,tmp
map$(x,y)=chr$(tmp)
next x
next y
close file 1
endfunction
Ive only had DarkBasic for about 7h or so and Please dont critizies of my coding is insufficient. But you can give me hints.
I think the problem is inside the for loop where i put ID, but if i fill ID with y or x i get the same problem so im stumped Please help me great community my goal is to adventually make a top down rpg game.
Jacob Gardam