Driving Game (WIP)

Blitz3D Forums/Blitz3D Programming/Driving Game (WIP)

Because the 'buildings' are primitives (i.e. created with CreateCube) they only have one surface, each face is made of two triangles so the texture will be stretched along them. My advice would be to make the buildings 3 cubes high

As for the collisions, you need to set the EntityType, which tells the program which objects collide with which and the responses to those collisions.

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.bmp")
building=CreateCube()
ScaleMesh building,25,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)
 EntityType cube,1
  PositionEntity cube,y * 200,0,x * 100

 cube=CopyEntity(building)
 EntityType cube,1 
PositionEntity cube,y*200,50,x*100

 cube=CopyEntity(building)
EntityType cube,1
 PositionEntity cube,y*200,100,x*100

 Next
Next
MoveEntity camera,100,5,0

EntityType camera,0
Collisions 0,1,3,1

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