EntityCollided

Blitz3D Forums/Blitz3D Beginners Area/EntityCollided

I still can't seemt o get it.

The code for generating the blocks is as follows

Function Create_map();Generates the 3d visible map
	For x=0 To 10
		For y=0 To 10
			If map(x,y)=2
				a.Map = New map
				a\Mesh =CreateCube ()
				EntityType a\mesh,Col_Scnery
				PositionEntity a\mesh,x,0,y
				ScaleEntity a\mesh,0.5,1,0.5
				a\Make = Map(x,y)	
			EndIf
		Next
	Next
End Function


and the code once again but modified for delting the blocks as follows.

Function Block_distroy()
	For x.bullet = Each Bullet
		If EntityCollided(x\mesh,Col_Scnery)
			DebugLog"Collieded"
			FreeEntity x\Mesh
			Delete x
		EndIf
	Next
End Function


and the part to declare the collision types are

Const Col_Scnery=2