C SHOP + COLLISIONS

Blitz3D Forums/Blitz3D Programming/C SHOP + COLLISIONS

TAGGART UK(Posted 2004) [#1]
Please help No Collisions????



;Collisions With Cartography Shop


; Collision variables...
Const COLLISION_OBSTICLE = 1 ; Walls, etc..
Const COLLISION_PLAYER = 2 ; The player..


If Windowed3D() Graphics3D 800,600,16,1
SetBuffer BackBuffer()


;cam=CreateCamera()
;CameraRange cam,1,100
;MoveEntity cam,0,60,-100
;EntityType cam,1
;CameraZoom cam,1.5


Collisions COLLISION_PLAYER,COLLISION_OBSTICLE,2,2


Global sceneCamPiv = CreatePivot()

; Turn the pivot into the player...
EntityType sceneCamPiv,COLLISION_PLAYER
EntityRadius sceneCamPiv,2

; Attach the camera to the pivot
Global sceneCamera = CreateCamera(sceneCamPiv)

map=LoadMesh("Level1.x")
lightmap=LoadMesh("Level1_lm.x")
EntityFX map,1
EntityFX lightmap,1
EntityBlend lightmap,2
EntityParent lightmap,map

EntityType map,COLLISION_OBSTICLE


While Not KeyHit(1)

If KeyHit(17)
wire=Not wire
WireFrame wire
EndIf



If KeyDown(200) Then
MoveEntity sceneCamPiv,0,0,4
EndIf

If KeyDown(208) Then
MoveEntity sceneCamPiv,0,0,-4
EndIf

If KeyDown(203) Then
TurnEntity sceneCamPiv,0,1,0
EndIf

If KeyDown(205) Then
TurnEntity sceneCamPiv,0,-1,0
EndIf


RenderWorld
Flip
Wend


Shambler(Posted 2004) [#2]
I see no updateworld() call in your main loop.


N(Posted 2004) [#3]
What Shambler said...


TAGGART UK(Posted 2004) [#4]
THE ACTUAL PLUGIN CODE FROM C.SHOP
DOES'NT HAVE THE UPDATEWORLD??

MANY THANKS SHAMBLER AND LORD PLACID

ADDED UPDATEWORLD WORKS GREAT.


GfK(Posted 2004) [#5]
WORKS GREAT
Shame we can't say the same about your CAPS LOCK key...


Dreamora(Posted 2004) [#6]
thats sample code taggart
if you are unable to program in Blitz3D yet, you better give CS a break and learn B3D first ...


Shambler(Posted 2004) [#7]
Sample code which sets up collisions but does not check for / react to them...very useful.