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.

------------------------------------------------------------

i have got everything how i wanted it to be and everything is great (thanks to Ross) but i would like to add one more thing to my "game".

Right now whenever i touch the wall or a 'penguin' then i automatically lose. I would like to add some "lives" for the player so that he can hit the wall severall times before he loses.

here is the code but it doesnt work :(..please correct the mistakes

crash=5
If timeleft < 0 Or crash=0 Then 
     Cls
Graphics 1024,768  
End=LoadImage ("ice_end.bmp")
     DrawImage End,0,0
     Flip
     WaitKey() 
     If KeyDown(1) Or (57) Or (28) Then End
     If KeyHit (57) Then Goto start
     EndIf

If EntityCollided (camera, type_sphere) > 0 Then
            sphere=CollisionEntity (camera,1)    				
crash=crash-1
EndIf

If EntityCollided (camera, type_obstacle) > 0 Then
		wall=CollisionEntity (camera,1)
	crash=crash-1
EndIf


and here i display the amount of lives left, so that the player can see how many times he can touch the wall or 'penguin' again:
Text 450,10, "Lives Left: "+crash



So the problem is that whenever i touch the wall or penguin, the amount of lives goes down by 1. The bad thing is that when i move away from the object, my amount of lives go back up. :(

please help...anyone