Ack sorry, thought i was supposed to put coding in the "Code" section of the "post forum message" box.
One other thing I noticed that was wrong with my code (i think): you see that I have declared the variables cellxsize, cellysize, and cellzsize at the top of hte program (globally, or so i thought) and within the function MakeGrid(). That is because if i run the MakeGrid() function without the variables declared in it, the program doesn't even draw the first box to the screen, there are no visible boxes. Does DBPro use local/global variables, or am i doing something wrong?
Ok here's my code:
`setup camera
make camera 1
position camera 1, 40,-38.5,-75
`setup lighting
set ambient light 100
color ambient light rgb(255,255,255)
`setup sound
load sound "zap.wav", 1
`setup background
load image "background.jpg", 1
make object plain 65, 153.6, 115.7
position object 65, 51.2,-38.9,0
texture object 65,1
`setup textures
load image "jsrf.jpg", 2
`setup variables
CellXSize = 10
CellYSize = 10
CellZSize = 2
`Create datatype for cells of the grid
Type CellInfo
CellXPosition as integer
CellYPosition as integer
ClearCell as integer
NumericCell as integer
CellLife as integer
endtype
`set original values for cell data
Counter = 1
DIM Grid(64) as CellInfo
for Counter = 1 to 64
Grid(Counter).CellXPosition = 0
Grid(Counter).CellYPosition = 0
Grid(Counter).ClearCell = 1
Grid(Counter).NumericCell = 0
Grid(Counter).CellLife = 0
next Counter
`///////////////////////////////////////////////START OF MAIN LOOP///////////////////////////////////////////////
MakeGrid()
wait key
`////////////////////////////////////////////////END OF MAIN LOOP////////////////////////////////////////////////
function MakeGrid
CellXSize = 10
CellYSize = 10
CellZSize = 2
Counters = 0
xpos = 0
ypos = 0
zpos = 0
`****************draws the grid of cells on screen***********************
for Counters = 1 to 64
make object box Counters, CellXSize,CellYSize,CellZSize
texture object Counters, 2
````color object Counter, rgb(255,255,255)
position object Counters,Grid(Counters).CellXPosition, Grid(Counters).CellYPosition, 0
Grid(Counters).CellXPosition = Grid(Counters).CellXPosition + 11
print Grid(Counters).CellXPosition
print Grid(Counters).CellYPosition
if Grid(Counters).CellXPosition >= 87
Grid(Counters).CellXPosition = 0
Grid(Counters).CellYPosition = Grid(Counters).CellYPosition -11
endif
wait 30
next Counters
remstart
for Counters = 1 to 64
make object box Counters, 10,10,2
texture object Counters, 2
````color object Counter, rgb(255,255,255)
position object Counters,xpos,ypos,zpos
xpos = xpos + 11
if xpos >= 87
xpos = 0
ypos = ypos -11
endif
wait 100
next Counters
remend
endfunction
remstart
function KeyIsPressed
do
if inkey$() = chr$(097)
print "hello world"
exit
endif
loop
endfunction
remend
Thank you for your help
DBPro User
PC: WinXP, 80gb HD, Nvidia GeForce FX 5200 (128mb onboard RAM), 512mn DDR400 RAM. Thank you for your help.