public int[] projectWall(RayIntersect intercept, BufferedImage texture, double distance, int x){

        Screen screen = raycaster.getBuffer();
        Camera camera = raycaster.getCamera();

        int[] wall = this.getWallProjection(screen, camera, intercept.getWall(), distance);

        if(distance > camera.getViewDistance()){
            return wall;
        }

        int wallY1 = wall[0];
        int wallY2 = wall[1];

        int textureWidth = texture.getWidth();
        int textureHeight = texture.getHeight();

        int pixelX = (int)(intercept.getIntercept() * (double)(textureWidth));
        if(pixelX >= textureWidth){
            pixelX = textureWidth-1;
        }

        int yDiff = wallY2 - wallY1;

        int screenY1 = wallY1;
        if(screenY1 < 0){
            screenY1 = 0;
        }
        int screenY2 = wallY2;
        if(screenY2 > screen.getHeight()){
            screenY2 = screen.getHeight();
        }

        for(int y = screenY1; y < screenY2; y++){

            int pixelY = (int)((((double)(y - wallY1))/(double)yDiff) * (textureHeight));
            if(pixelY >= textureHeight){
                pixelY = textureHeight-1;
            }

            int pixel = Shader.getColour(texture.getRGB(pixelX, pixelY), distance);

            screen.setPixel(x, y, pixel, distance);

        }

        return wall;
    }