Okay well as some of you may know Im just learning, or relearning as it were how to program.
I have been working on images in 2D working towards a tilebased map editor. So Ive gotten a lot better in the past few days in my understanding of how to accomplish the task, the code may not be optimum or elegant, but it works.
Now as I understand it the program should read the tile assignments from the data lines in the program, well it dont work. Changing any of the numbers ussually has the effect of changing more than just one tile(note;I'm only using two tiles for simplicity sake).
sync on:sync rate 60
set display mode 800,600,16
rem both images are 32 x 32
load image "dirtBmp.bmp",1
load image "darkgrassBmp.bmp",2
rem set variables
width=6
height=5
xcount=0
offsetx=0
offsetx2=0
offsetx3=0
offsetx4=0
offsetx5=0
offsetx6=0
offsety=10
offsety2=42
offsety3=74
offsety4=106
offsety5=138
rem fill world array------------------------------
dim world(width,height)
for x=0 to 6
for y=0 to 5
read blocks
world(x,y)=blocks
next y
next x
rem ---------------------------------------------------
rem game loop
do
rem draw world--------------------------------------------
for x=0 to 6
for y=0 to 5
xcount=xcount+1
if xcount <6
if world(x,y)=0 then paste image 1,offsetx,offsety
if world(x,y)=1 then paste image 2,offsetx,offsety
if world(x,y)=0 then paste image 1,offsetx2,offsety2
if world(x,y)=1 then paste image 2,offsetx2,offsety2
if world(x,y)=0 then paste image 1,offsetx3,offsety3
if world(x,y)=1 then paste image 2,offsetx3,offsety3
if world(x,y)=0 then paste image 1,offsetx4,offsety4
if world(x,y)=1 then paste image 2,offsetx4,offsety4
if world(x,y)=0 then paste image 1,offsetx5,offsety5
if world(x,y)=1 then paste image 2,offsetx5,offsety5
if world(x,y)=0 then paste image 1,offsetx6,offsety5
if world(x,y)=1 then paste image 2,offsetx6,offsety5
offsetx=offsetx+32
offsetx2=offsetx2+32
offsetx3=offsetx3+32
offsetx4=offsetx4+32
offsetx5=offsetx5+32
offsetx6=offsetx6+32
endif
next y
next x
rem -------------------------------------------------------
sync
loop
rem world---------------------------
data 1,1,1,1,1,1
data 1,0,0,0,0,1
data 1,0,0,0,0,1
data 1,0,0,0,0,1
data 1,1,1,1,1,1
rem
wait key
So if someon can take a look at the code maybe you can see what the problem is. Suggestions are welcome, keep in mind I just started, things that may be obvious to you, arent so to me. Thanks a ton in advance.. Grais
ps: almost forgot, another question I have, why are the maps when they are 5x5 not square ? It seems they are rectangular, but the size is 32x32, Too get it to look square I have to go 6x5, just the way it is I guess ?