Here is the code:

Code java:

float verticalXDistance, verticalYDistance;
float Xa, Ya;
// UP
// A.y = rounded_down(Py/TILE_SIZE) * (TILE_SIZE) - 1;
if (angle > 0 && angle < DEG180) {
verticalYDistance = (float) (playerY / TILE_SIZE * TILE_SIZE) - 1;
Ya = -TILE_SIZE;
}
// DOWN
// A.y = rounded_down(Py/TILE_SIZE) * (TILE_SIZE) + TILE_SIZE;
else {
verticalYDistance = (float) (playerY / TILE_SIZE * TILE_SIZE) + TILE_SIZE;
Ya = TILE_SIZE;
}
// A.x=Px+(Py-A.y)/tan(ALPHA)
verticalXDistance = (float) (playerX + ((playerY - verticalYDistance) / tanPreRendered[angle]));
float fvdx = verticalXDistance;
float fvdy = verticalYDistance;
// Xa=TILE_SIZE/tan(ALPHA)
Xa = Math.abs(TILE_SIZE / tanPreRendered[angle]);
// makes it so that if the angle is90=270, the additive is negative
if (angle > DEG90 && angle < DEG270)
Xa = -Xa;
float verticalDistance = 0;
// ignores cases when distance goes out of map
if (angle == 0 || angle == DEG180)
verticalDistance = Float.MAX_VALUE;
else {
// repeat, check all points on line until wall is found
while (true) {
if ((int) (verticalXDistance / TILE_SIZE) >= map[0].length
|| (int) (verticalYDistance / TILE_SIZE) >= map.length
|| (int) (verticalXDistance / TILE_SIZE) < 0
|| (int) (verticalYDistance / TILE_SIZE) < 0) {
// verticalDistance = Float.MAX_VALUE;
break;
}
if (map[(int) (verticalYDistance / TILE_SIZE)][(int) (verticalXDistance / TILE_SIZE)] == WALL){
// PD=ABS(Px-Dx)/cos(ALPHA)=ABS(Py-Dy)/sin(ALPHA)
verticalDistance = Math.abs((playerY - verticalYDistance) / sinPreRendered[angle]);
break;
}
verticalXDistance += Xa;
verticalYDistance += Ya;
}
}
//
// CHECKING ALL OF THE HORIZONTAL INTERSECTIONS
//
float horizontalXDistance, horizontalYDistance;
float Xb, Yb;
// LEFT
// B.x = rounded_down(Px/TILE_SIZE) * (TILE_SIZE) - 1.
if (angle > DEG90 && angle < DEG270) {
horizontalXDistance = (float) (playerX / TILE_SIZE * TILE_SIZE) - 1;
Xb = -TILE_SIZE;
}
// RIGHT
// B.x = rounded_down(Px/TILE_SIZE) * (TILE_SIZE) + TILE_SIZE.
else {
horizontalXDistance = (float) (playerX / TILE_SIZE * TILE_SIZE)
+ TILE_SIZE;
Xb = TILE_SIZE;
}
// A.y = Py + (Px-A.x)*tan(ALPHA);
horizontalYDistance = (float)(playerY
+ ((playerX - horizontalXDistance) * tanPreRendered[angle]));
float fhdx = horizontalXDistance;
float fhdy = horizontalYDistance;
// Ya=TILE_SIZE*tan(ALPHA)
Yb = Math.abs(TILE_SIZE * tanPreRendered[angle]);
// makes it so that if the angle is 0-180, the additive is negative
if (angle > 0 && angle < DEG180)
Yb = -Yb;
// repeat, check all points on line until wall is found
float horizontalDistance = 0;
// ignores if case goes out of map
if (angle == DEG90 || angle == DEG270)
horizontalDistance = Float.MAX_VALUE;
else {
while (true) {
if ((int) (horizontalXDistance / TILE_SIZE) >= map[0].length
|| (int) (horizontalYDistance / TILE_SIZE) >= map.length
|| (int) (horizontalXDistance / TILE_SIZE) < 0
|| (int) (horizontalYDistance / TILE_SIZE) < 0) {
// horizontalDistance = Float.MAX_VALUE;
break;
}
if (map[(int) (horizontalYDistance / TILE_SIZE)][(int) (horizontalXDistance / TILE_SIZE)] == WALL){
// PE=ABS(Py-Ey)/sin(ALPHA)=ABS(Px-Ex)/cos(ALPHA)
horizontalDistance = Math.abs((playerX - horizontalXDistance) / cosPreRendered[angle]);
break;
}
horizontalXDistance += Xb;
horizontalYDistance += Yb;
}
}

What I know is the coordinates for the moles are stored in the game.js, but I am unable to change the features to the click to whack.

If someone can help me change it, I would be grateful.

The current engine that I am using is atom, but I also have jquery in there and loaded.

stuff is in the attachments. Any help would be great