Collisions help?

Blitz3D Forums/Blitz3D Beginners Area/Collisions help?

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.

You mean .. other than read my post again? I don't think I could make it simpler! Anywho - this example should work ..

Graphics3D 640,480
SetBuffer BackBuffer()

;Set global on font variables
Global fntArial
;Load fonts to a file handle variables
fntArial=LoadFont ("Arial",15,False,False,False)
;Set the font and print text
SetFont fntArial
;Opening title
Print "Explorer program: Press the arrow keys to move forward, backwards, left, and right."
WaitKey 
;Create a light
CreateLight()
;Camera
camera=CreateCamera()
RotateEntity camera,45,0,0
;Set up the numbers
type_player=1
type_obstacle=2
;Create the sphere
sphere=CreateSphere ()
PositionEntity sphere,9,4,1
EntityType sphere,type_player 


;Textures
tex=LoadTexture ("texture1.jpg")
ScaleTexture tex,.5,.5
EntityTexture sphere, tex
;Create some terrain
ground=LoadTerrain("maze.jpg")
ScaleEntity ground,5,100,5
PositionEntity ground,-500,0,-500
texture2=LoadTexture("texture2.jpg")
EntityTexture ground, texture2
EntityType ground, type_obstacle
Collisions type_player, type_obstacle,2,3
;Begin
While Not KeyDown (1)
If KeyDown (208) TranslateEntity sphere,0,0,-0.3
If KeyDown (200) TranslateEntity sphere,0,0,0.3
If KeyDown (205) TranslateEntity sphere,0.3,0,0
If KeyDown (203) TranslateEntity sphere,-0.3,0,0
If KeyDown (16)=True Then pitch#=pitch#-1
If KeyDown (17)=True Then pitch#=pitch#+1
If KeyDown (18)=True Then yaw#=yaw#-1
If KeyDown (19)=True Then yaw#=yaw#+1
If KeyDown (20)=True Then roll#=roll#-1
If KeyDown (21)=True Then roll#=roll#+1
PositionEntity camera, EntityX(sphere),0,EntityZ(sphere)
MoveEntity camera,0,0,-20

UpdateWorld()
RenderWorld()
Flip
Wend
End