Driving Game (WIP)

Blitz3D Forums/Blitz3D Programming/Driving Game (WIP)

Here's the code so far:

Graphics3D 800,600 
SetBuffer BackBuffer() 
camera=CreateCamera()
CameraClsColor camera,70,80,255 
light=CreateLight() 
RotateEntity light,0,90,0
plane=CreatePlane()
EntityColor plane,63,63,63
tex=LoadTexture("buildingwall03.tga")
building=CreateCube()
ScaleMesh building,75,25,25
EntityTexture building,tex
PositionMesh building,0,25,0
HideEntity building
For x = 0 To 50
 For y = 0 To 25
  cube=CopyEntity(building)
  PositionEntity cube,y * 200,0,x * 100
 Next
Next
MoveEntity camera,100,5,0
While Not KeyDown( 1 ) 
 If KeyDown( 205 )=True Then TurnEntity camera,0,-0.5,0
 If KeyDown( 203 )=True Then TurnEntity camera,0,0.5,0
 If KeyDown( 208 )=True Then MoveEntity camera,0,0,-1
 If KeyDown( 200 )=True Then MoveEntity camera,0,0,1
 RenderWorld 
 Flip 
Wend 
End


Two questions:

How to tile a bitmap texture three times along the long walls and one time along the short walls of the buildings?

How to set up collision tests between camera and buildings?