I am trying to make an object move half a circle. I currently have it moving in a full circle, but I can't get it to stop halfway the loop.
I add 200 to the location so it appears somewhere in the middle.
I multiply the sine and cosine of i by 100 so it will not be stuck in the range of -1 <> 1. --> so it will be visible on screen.
But how am I going to make it able to stop halfway the circle?

public class NPC extends Actor { private double i = 0; private int xi; private double xd; private int yi; private double yd; public void act() { i = i + 0.01; xd = Math.cos(i)*100; yd = Math.sin(i)*100; int xi = (int) xd; int yi = (int) yd; setLocation(xi + 200, yi + 200); } }