Please help: collisions

Blitz3D Forums/Blitz3D Beginners Area/Please help: collisions

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.

here is an example i made which is basically the same problem- I would like that when the sphere touches the cube the life goes down by one and stays that way.
PLEASE TRY THIS YOURSELF BY COPYING THIS CODE TO YOUR B3D

---use the left and right arrow keys to move sphere---

Graphics3D 800,600

  type_cube=1
  type_sphere=2

  SetBuffer BackBuffer()

  camera=CreateCamera()
  CameraViewport camera,0,0,800,600
  PositionEntity camera,0,0,-5

  light=CreateLight()

  cube=CreateCube()
  PositionEntity cube,-5,0,5
  EntityColor cube,70,80,190
  EntityType cube,type_cube

  sphere=CreateSphere(12)
  PositionEntity sphere,5,0,5
  EntityColor sphere,170,80,90
  EntityType sphere,type_sphere

  Collisions type_sphere,type_cube,3,1

  While Not KeyHit(1)

If KeyDown(205)=True Then MoveEntity sphere, 0.5,0,0
If KeyDown(203)=True Then MoveEntity sphere, -0.5,0,0

lives=5
 	
If EntityCollided(sphere,type_cube)> 0 Then
 		ball=CollisionEntity (sphere, 1) 
	lives=lives-1
EndIf

 UpdateWorld
  RenderWorld

  

  Text 335,500,"Lives Left: "+lives
  Flip

  Wend

  End