Some reason this formula doesn’t guide “angle” to “(float) Math.toDegrees(Math.atan2(x - target.x, -(y - target.y)))”
Can someone tell me what I’m doing wrong?
if(angle > (float) Math.toDegrees(Math.atan2(x - target.x, -(y - target.y))) &&
angle <= -((float) Math.toDegrees(Math.atan2(x - target.x, -(y - target.y)))))
angle -= handleing;
else if(angle < (float) Math.toDegrees(Math.atan2(x - target.x, -(y - target.y))) &&
angle > -((float) Math.toDegrees(Math.atan2(x - target.x, -(y - target.y)))))
angle += handleing;
x -= Math.sin(Math.toRadians(angle)) * speed;
y += Math.cos(Math.toRadians(angle)) * speed;