With coming up with an artificial intelligent function, how would I have one shape follow another? I've gotten a decent distance formula that works, but How would I make the other shape follow? I'm in desperate need of help tonight.
Thanks.
Depends on the situation, environment, etc
The simplest answer is copy the movements of the thing being followed
yeah, but then the movement is static, I'm trying to use a for loop and have the shape work it's way to the other shape... But some reason it's not working either..
Have a timer that determines the location of the object to follow, and move one increment towards those numbers. For instance, if the first object is at 130, 72 and the second object is at 200,50, you would want to move the second object -1,+1.
Example:
If objFollow.Left > objFind.Left Then
objFollow.Left = objFollow.Left - 1
ElseIf objFollow.Left < objFind.Left Then
objFollow.Left = objFollow.Left + 1
End If
If objFollow.Top > objFind.Top Then
objFollow.Top = objFollow.Top - 1
ElseIf objFollow.Top < objFind.Top Then
objFollow.Top = objFollow.Top + 1
End If
Works beautifully thanks Andy.
Any time ;)