Distance

Blitz3D Forums/Blitz3D Programming/Distance

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.

Not sure if this'll help but why are you using approximate distances?

you can replace all of this
Function CheckBox()

If Distance(Player,Box) < 2 Then
	RuntimeError Name$ + "Won!!!!!"
EndIf

End Function

Function Distance(Entity1,Entity2)

Entity1Pos = EntityZ(Entity1) + EntityY(Entity1) + EntityX(Entity1)

Entity2Pos = EntityZ(Enitiy2) + EntityY(Entity2) + EntityX(Entity2)

Return Entity1Pos - Entity2Pos

End Function




with ..


Function CheckBox()

If entityDistance(Player,Box) < 2 Then
	RuntimeError Name$ + "Won!!!!!"
EndIf



Also, instead of your resize mesh function just use FITMESH.

Not sure if this'll help just thought I'd point out a few things