Cartography Shop Collisions

Blitz3D Forums/Blitz3D Programming/Cartography Shop Collisions

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Still no collisions?????



Graphics3D 640,480,16,1

SetBuffer BackBuffer()
AmbientLight 255,255,255


player=CreateCamera()
CameraClsColor player,225,225,225
PositionEntity player,-15.0,12.0,-16


Level1=LoadAnimMesh("Map/level1.b3d")
ScaleEntity level1,.1,.1,.1
PositionEntity level1,0,0,0


t_player=1
t_level=2
EntityType level1,t_level
EntityType player,t_player
EntityRadius player,1.5,.75

Collisions t_player,t_level,2,2 ; define Collisions checks



While Not KeyHit(1)
If KeyHit (17) Then
WireMode = Not WireMode
WireFrame WireMode
End If



TranslateEntity player,0,-.01,0 ; simplified Gravity



If KeyDown(200) Then

MoveEntity Player,0.0,0.0,0.5 ;move forward

EndIf

If KeyDown(208) Then

MoveEntity Player,0.0,0.0,-0.5 ;move backward

EndIf


If KeyDown(203) Then

TurnEntity Player,0.0,2.0,0.0
;move left

EndIf


If KeyDown(205) Then

TurnEntity Player,0.0,-2.0,0.0 ;move right

EndIf



If KeyDown(201) Then

MoveEntity Player,0.0,0.1,0.0 ;up

EndIf

If KeyDown(209) Then

MoveEntity Player,0.0,-0.1,-0.0 ;down

EndIf




UpdateWorld
RenderWorld



; FPS *********************************************************************************************
frames=frames+1
If MilliSecs()-render_time=>1000 Then fps=frames : frames=0 : render_time=MilliSecs()
Text 10,700,"FPS "+fps


Text 100,700,"Surfaces:"+CountSurfaces(level1)
For i=1 To CountSurfaces(level1)
Text 200,i*760,"Triangles in Surface "+i+":"+CountTriangles(GetSurface(level1,i))
Next


Flip
Wend

End