scaling down

Blitz3D Forums/Blitz3D Beginners Area/scaling down

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.

hi all, i dont know how to explain what i am trying to do so here it is in points:
-i have a cube and a sphere
-you move the sphere towards the cube
-once the cube and the sphere collide the cube gets shorter and the sphere dissapears

Everything works well until the cube and sphere collide. When they do, the sphere dissapears but the cube keeps getting shorter even though nothing is colliding with it. I kind of know why this is but i dont know how to change it. Here is the code (in the main loop):
If EntityCollided (sphere, type_cube) And health=>2 Then 
	y=y-1
	health=health-1
	HideEntity sphere
EndIf

ScaleEntity cube, x, y, z


i put health as 10 and y as 10 in the beginning. Does anyone know how i could make it so that when the sphere collides with the cube, the cube gets shorter by 1 and no more, until another sphere collides with it?

Thanks alot