I was going through the collision tutorial that came with blitz, and I came across a error doing it myself. Everytime I try to run the code I get the error 'Expecting EndIf'. I don't know why it's doin it, hopefully someone here can help. Here is my code:
Graphics3D 800, 600
Const col_sphere = 1
Const col_cube = 2
SetBuffer BackBuffer()
camera = CreateCamera()
PositionEntity camera, 0, 0, -5
light = CreateLight()
sphere = CreateSphere(12)
PositionEntity sphere, -5, 0, 5
EntityType sphere, col_sphere
cube = CreateCube()
PositionEntity cube, 5, 0, 5
EntityType cube, col_cube
Collisions col_sphere, col_cube, 3, 1
While Not KeyHit(1)
MoveEntity sphere, .1, 0, 0
RenderWorld
UpdateWorld
If EntityCollided (sphere, col_cube) Then
Text, 300, 300, "Collided!"
EndIf
Flip
Wend
End
Thanks in advance for help
Graphics3D 800, 600
Const col_sphere = 1
Const col_cube = 2
SetBuffer BackBuffer()
camera = CreateCamera()
PositionEntity camera, 0, 0, -5
light = CreateLight()
sphere = CreateSphere(12)
PositionEntity sphere, -5, 0, 5
EntityType sphere, col_sphere
cube = CreateCube()
PositionEntity cube, 5, 0, 5
EntityType cube, col_cube
Collisions col_sphere, col_cube, 3, 1
While Not KeyHit(1)
MoveEntity sphere, .1, 0, 0
RenderWorld
UpdateWorld
If EntityCollided (sphere, col_cube) Then
Text, 300, 300, "Collided!"
EndIf
Flip
Wend
End
Thanks in advance for help