Collisions Problem

Blitz3D Forums/Blitz3D Beginners Area/Collisions Problem

Hotshot2005(Posted 2007) [#1]
Hiya all,

I trying to get Collisions between with camera and Terrain hills and also how I get player(or the camera) go up the hills.

(CODE)
; Set collision type values
type_ground =1
type_character=2
type_scenery =3


Graphics3D 640,480
SetBuffer BackBuffer()

camera=CreateCamera()
PositionEntity CAMERA,0,200,0
EntityType CAMERA,type_character

light=CreateLight()
RotateEntity light,90,0,0

; Load mesh
terrain=LoadMesh("Maps/TERRAIN.b3d")

PositionEntity terrain,0,0,0
EntityType CAMERA,type_ground
CameraRange camera,1,100000

; Enable collisions between type_character and type_ground
Collisions type_character,type_ground,2,2

While Not KeyDown( 1 )
If KeyDown( 205 )=True Then TurnEntity camera,0,-10,0
If KeyDown( 203 )=True Then TurnEntity camera,0,10,0
If KeyDown( 208 )=True Then MoveEntity camera,0,0,-15
If KeyDown( 200 )=True Then MoveEntity camera,0,0,10
If KeyDown( 57 ) =True Then MoveEntity camera,0,10,0

RenderWorld
UpdateWorld
Flip
Wend

End
(/CODE)


Quantum(Posted 2007) [#2]
You need to use the `EntityType` & `collisions` command.

entitytype player,1 ; sets player type
entitytype scene,2 ; sets scene type

collisions 1,2,2,2 ; (player),(scene),(method),(response)


Hotshot2005(Posted 2007) [#3]
thank you Quantum :)