Just basic movement of an sprite, towards another sprite.
lerp(self.x, object2.x, 0.1)
will round actually stop it? i was thinking more of having a condition to make the event false if it was close enough, if the distance between object1 and object2 is less than a certain amount ... The point is that I'm trying to optimize for a lot of objects, so i don't want heavy calculations.
maybe compare condition like this would be suffice, but I'm not sure if distance calculations for a lot of objects is very performance friendly?
distance(object1.x, object2.x) > 0.5
lerp(self.x, object2.x, 0.1)
Or maybe it would be better to add a variable to object 1 which holds the last x postion, then checking if last position x (minus) current position x is less 0.5? or something like that, but I guess i always have to return a positive value then.
abs(object1.lastpos-object2.x) > 0.5
lerp(self.x, object2.x, 0.1)
set object1.lastpos to self.x
or something like that? lol
Just specilating Maybe that would work... better try.