R0J0hound can you explain how and why this works? I mean I plugged it in and it works exactly as you say. The object moves in 180 arcs until it reaches the end destination.. But why? Can you walk through the code and explain what is happening?
Give the enemy these variables: t=1, cx,cy, a, r
On some trigger
— enemy: set t to 0
— enemy: set cx to (self.x+destination.x)/2
— enemy: set cy to (self.y+destination.y)/2
— enemy: set a to angle(destination.x, destination.y, self.x, self.y)
— enemy: set r to distance(self.x,self.y,destination.x,destination.y)/2
Enemy: t<1
— enemy: set t to min(1, self.t+dt)
— enemy: set x to self.cx+self.r*cos(self.a+180*self.t)
— enemy: set y to self.cy+self.r*sin(self.a+180*self.t)
That will make the enemy move in a half circle arc. More subtle arcs could be possible too with further tweaks of the equations.
Also note both methods will complete the motion in one second. To make it complete in say 0.5 seconds change the *dt to *2*dt in the equations.