hi,
i was reading the forums and came accross someone who said the easiest way to think of types is like a database of items with fields etc. This got me thinking.
If i wanted to create a tiling grid and i create the following type to hold the tile details:
type gridpoint
field Xloc
field Yloc
field Tiletype
end type
then populate it like so:
.restore Levelmap1
for x = 0 to 15
for y = 0 to 11
grid1.gridpoint = new gridpoint
grid1\xloc = x * 50
grid1\yloc = y * 50
read grid1/tiletype
next
next
this should create a, 800 x 600 grid split into 50 X 50 tiles and stores the tile types from an imaginary data set :levelmap1. And all the data should, essentially, be stored in big 3d array somewhere in the comps memory (ie: gridpoint(xloc,yloc,tiletype)
Now, i was wondering if it is possible to create seperate record sets from gridpoint using something along the lines of and SQL style 'select' statement. for example:
select * from [gridpoint] where x= 400 and y = 300
then you could use and 'each type' loop to run through a specific selection of the gridpoint list?
I'm not sure if i have explained this very well, but if anyone need clarification, i'll try again :D
thanks
~V~
i was reading the forums and came accross someone who said the easiest way to think of types is like a database of items with fields etc. This got me thinking.
If i wanted to create a tiling grid and i create the following type to hold the tile details:
type gridpoint
field Xloc
field Yloc
field Tiletype
end type
then populate it like so:
.restore Levelmap1
for x = 0 to 15
for y = 0 to 11
grid1.gridpoint = new gridpoint
grid1\xloc = x * 50
grid1\yloc = y * 50
read grid1/tiletype
next
next
this should create a, 800 x 600 grid split into 50 X 50 tiles and stores the tile types from an imaginary data set :levelmap1. And all the data should, essentially, be stored in big 3d array somewhere in the comps memory (ie: gridpoint(xloc,yloc,tiletype)
Now, i was wondering if it is possible to create seperate record sets from gridpoint using something along the lines of and SQL style 'select' statement. for example:
select * from [gridpoint] where x= 400 and y = 300
then you could use and 'each type' loop to run through a specific selection of the gridpoint list?
I'm not sure if i have explained this very well, but if anyone need clarification, i'll try again :D
thanks
~V~