public static Direction getPlayerDirection(int x, int y) {
        if (x != 0) {
            if (x > 0) {
                if (y > 0) {
                    return Direction.DOWNRIGHT;
                } else if (y < 0) {
                    return Direction.UPRIGHT;
                } else {
                    return Direction.RIGHT;
                }
            } else {
                if (y > 0) {
                    return Direction.DOWNLEFT;
                } else if (y < 0) {
                    return Direction.UPRIGHT;
                } else {
                    return Direction.LEFT;
                }
            }
        } else if (y != 0 && x == 0) {
            if (y > 0) {
                return Direction.DOWN;
            } else {
                return Direction.UP;
            }
        } else {
            return Direction.IDLE;
        }
    }