Finding the closest

Blitz3D Forums/Blitz3D Programming/Finding the closest

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.

targetball = null
Distance = 100000
for ball = firstball to lastball
if entitydistance(ball,bat)<Distance
Distance = entitydistance(ball,bat)
TargetBall = ball
endif
next