public int[][] makeTileMap(ArrayList<GameEntity> entities){
        int width=1;
        int height=1;
        startX=entities.get(0).getStartX();
        startY=entities.get(0).getStartY();
        int tileSize=GlobalSettings.tileSize;
        // get the dimensions of the tileMap
        for(int i=1;i<entities.size();i++){
            int entX=entities.get(i).getStartX();
            int entY=entities.get(i).getStartY();
            //boolean block=entities.get(i).isBlock();
            if(entX<startX){
                if((startX-entX)/tileSize==0)
                    System.out.println("Zero added");
                width+=((startX-entX)/tileSize);
                startX=entX;
            }
            if(entY<startY){
                height+=((startY-entY)/tileSize);
                startY=entY;
            }
            if(entX>startX+width*tileSize){
                //int temp=width;
                width+=((entX-(startX+width*tileSize))/tileSize);
                //if(temp>width)
                //    System.out.println("BUG HAS BEEN FOUND");
            }
            if(entY>startY+height*tileSize){
                //int temp=height;
                height+=((entY-(startY+height*tileSize))/tileSize);
                //if(temp>height)
                //    System.out.println("BUG HAS BEEN FOUND");
            }
        }
        // height=6
        // width=7
        // both == 8
        height++;
        width++;
        // Create the tileMap
        int[][] tileMap=new int[height][width];
        System.out.println("Width :: "+width+" Height :: "+height);
        for(int i=0;i<entities.size();i++){
            boolean block=entities.get(i).isBlock();
            if(block){
                int xpos=(entities.get(i).getStartX()-startX)/tileSize;
                //System.out.println(xpos);
                int ypos=(entities.get(i).getStartY()-startY)/tileSize;
                tileMap[ypos][xpos]=1;
            }
        }
        return tileMap;
    }