atan2(-dy, dx) * 180 / Math.PI);
if (theta < 0)
theta += 360;
// Hit the pointer?
if (Math.abs(dx) < d && Math.abs(dy) < d)
initAnt(i);
// If not, move the ant and set the image based on angle.
else if (theta > 23 && theta <= 68) {
moveLayerBy(ants[i], d, -d);
ants[i].image.src = "antur.gif";
else if (theta > 68 && theta <= 113) {
moveLayerBy(ants[i], 0, -d);
ants[i].image.src = "antup.gif";
else if (theta > 113 && theta <= 158) {
moveLayerBy(ants[i], -d, -d);
ants[i].image.src = "antul.gif";
else if (theta > 158 && theta <= 20
|