Basically I am working on a tile editor and I have set up an array as a custom type and filled in all the information...then printed the tiles to the screen based on the array information. The output is supposed to be 25x25 tiles printed out in a square pattern.
sync on
sync rate 20
rem MAKE THE OUTLINE BOX
ink rgb(100,0,0),0
box 0,0,600,500
get image 1,0,0,600,500
sprite 1,0,0,1
rem LOAD THE TILES-- (100-150)
load image "tiles\standard.jpg",100
rem COLOR BACKGROUND
backdrop on
color backdrop 0
rem CREATE TILE TYPE
type Tile
number as integer
xpos as integer
ypos as integer
spnum as integer
endtype
rem CREATE TILE ARRAY
dim tiles(24,20) as Tile
rem Initialize Tiles
gosub _INIT_TILES
rem Set All Tiles To Default
for x=1 to 24
for y=1 to 20
tiles(x,y).number=100
next y
next x
for x=1 to 24
for y=1 to 20
sprite tiles(x,y).spnum,tiles(x,y).xpos,tiles(x,y).ypos,tiles(x,y).number
set sprite tiles(x,y).spnum,0,1
next y
next x
do
sync
loop
_INIT_TILES:
for t=1 to 24
for s=1 to 20
tiles(t,s).xpos=(25*t)-25
tiles(t,s).ypos=(25*s)-25
tiles(t,s).spnum=t+s
next s
next t
return
Instead of printing out in a square pattern it only prints out one horizontal row and one vertical column.
To test the above code just make a 25x25 pixel image and you will see what I mean.
Maybe im just not thinking straight or something, can someone please point out where I have gone wrong?
Thanks.