- Edited
I am looking for an ai engine to track the closet sprite to them (for example 2 players).
I am looking for an ai engine to track the closet sprite to them (for example 2 players).
'track the closest sprite next to them'?
wdym
to find the direction(angle) between two points:
var angle = atan2(target.y-subject.y,target.x-subject.x);
to have the subject move at that angle:
subject.x += cos(angle)*speed;
subject.y += sin(angle)*speed;
stretch the collider into a big circle around the sprite, then anything inside the collider shall be tracked with sprite.istouching
if there are several sprites in this circle, make a second, smaller circle
person
that's...
an interesting idea
nobody has to know how it works they just play the game
its kinda a stupid idea tho
it would be really laggy also
ackvonhuelio Actually you can make multiple sprites and then set the sprites containing the extra colliders to invisble. Then you can merge the main sprite and the extras into a group and you won't have to worry