I seem to be having another problem. I would like to draw the rows of bricks, but it isn't drawing properly, any idea why? :o) Thanks
Here's my code: (By the way I have started the code from scratch again :o)
Graphics3D 800,600
SetBuffer BackBuffer()
Global Cam_pivot = CreatePivot()
Global Camera = CreateCamera(Cam_pivot)
MoveEntity Cam_pivot,0,100,-65
RotateEntity Camera,45,0,0
Global Omni = CreateLight()
Global Area_x = 0
Global Area_z = 0
Global Area_width = 5
Global Area_height = 3
Global Brick_width = 10
Global Brick_height = 2
Global Brick_depth = 3
Global Brick = CreateCube()
FitMesh Brick,0,0,0,Brick_width,Brick_height,Brick_depth
;Global Board = LoadMesh("models/game_board.3ds")
Dim Bricks(Area_width-1,Area_height-1)
draw_level()
While Not KeyHit(1)
Cls
If KeyDown(200) Then MoveEntity Cam_pivot,0,0,1
If KeyDown(208) Then MoveEntity Cam_pivot,0,0,-1
UpdateWorld
RenderWorld
Flip
Wend
End
Function draw_level()
For z=0 To Area_height-1
For x=0 To Area_width-1
Bricks(x,z)=0
Next
Next
Restore level1
For z=0 To Area_height-1
For x=0 To Area_width-1
Read count
If count=1 Then Bricks(x,z) = CopyEntity(Brick)
Next
Next
For z=0 To Area_height-1
For x=0 To Area_width-1
PositionEntity Bricks(x,z),(Brick_width*Area_width),0,Area_z+(Brick_depth*Area_height)
Next
Next
End Function
.level1
Data 1,1,1,1,1
Data 1,1,1,1,1
Data 1,1,1,1,1