public void draw(Graphics g, GameContainer gc) {
        gc.getGraphics().setBackground(sky); 
        int minx = (int) -Math.ceil(drawx/16);
        int maxx = (int) (Math.ceil(LostAdventure.screenwidth/16))+minx+2;
        int miny = (int) -Math.ceil(drawy/16);
        int maxy = (int) (Math.ceil(LostAdventure.screenheight/16))+miny+2;
        if(minx < 0) { minx = 0; }
        if(maxx > width) { maxx = width; }
        if(miny < 0) { miny = 0; }
        if(maxy > height) { maxy = height; }
        for(int x=minx; x<maxx; x++) {
            for(int y=miny; y<maxy; y++) {
                if(map[x][y].blockimage != null) {
                    map[x][y].blockimage.draw(drawx+x*blocksize, drawy+y*blocksize);
                }
                else if(map[x][y].blockcolor != null) {
                    g.setColor(map[x][y].blockcolor);
                    g.fillRect(drawx+x*blocksize, drawy+y*blocksize, blocksize, blocksize);
                }
            }
        }
    }