collision help

Blitz3D Forums/Blitz3D Beginners Area/collision help

killal4(Posted 2003) [#1]
i am trying to make a firstperson shooter and i cant seam to make the collition coad to work here it is

Graphics3D 1280,1024

Const LEVEL_COL=1
Const CAMERA_COL=2
cube=CreateCube()
EntityType cube,CUBE_COL
HidePointer
Global camera=CreateCamera()
CameraRange camera,1,600
EntityRadius camera,7.5
EntityType camera,type_camera
PositionEntity camera,10,10,10

Collisions type_camera,type_scenery,2,3

level=LoadMesh( "lvl cabin.b3d" )
RotateEntity level,0,160,0
ScaleEntity level ,50,50,50
EntityType level,type_scenery
MoveEntity level,100,0,-500
While Not KeyHit(1)
If KeyDown(200) Then
EntityPickMode level,2
MoveEntity camera,0,0,1
EndIf

If KeyDown(208) Then
MoveEntity camera,0,0,-1
EndIf

If KeyDown(203) Then
TurnEntity camera,0,1.0,0
EndIf
If KeyDown (51) Then
MoveEntity camera,0,1,0
EndIf
If KeyDown(205) Then
TurnEntity camera,0,-1.0,0
EndIf
If KeyDown(52) Then
MoveEntity camera,0,-1,0
EndIf
UpdateWorld
RenderWorld
If EntityCollided (camera,type_scenery) Then
Text 1280,1024,"i did it!!!!!"
EndIf


Flip

Wend
End

End


big10p(Posted 2003) [#2]
You define the collision constants

Const LEVEL_COL=1 
Const CAMERA_COL=2 


and then never use them! Instead, you use type_camera and type_scenery which aren't defined. Change your constants to match everywhere that they're used and see how you get on.


killal4(Posted 2003) [#3]
Thanks!