private void initMap(LayeredMap map) {
        for(int y=0; y<map.getHeight(); y++) {
            for(int x=0; x<map.getWidth(); x++) {

                // random grass
                if(Math.random() < 0.5) {
                    map.set(LayerCodes.GROUND, x, y, FeatureCodes.GROUND + ColorCodes.GREEN);
                } else {
                    map.set(LayerCodes.GROUND, x, y, FeatureCodes.GROUND + ColorCodes.LEMONGREEN);
                }

                final double density = 2.0;

                // random trees
                if(Math.random() < 0.1 * density) {
                    map.set(LayerCodes.FEATURE, x, y, FeatureCodes.WALL_BRICKS);
                    map.set(LayerCodes.MOBILES, x, y, FeatureCodes.TREE + ColorCodes.GREEN);
                }
                if(Math.random() < 0.04 * density) {
                    map.set(LayerCodes.FEATURE, x, y, FeatureCodes.WALL_BRICKS);
                    map.set(LayerCodes.MOBILES, x, y, FeatureCodes.TREE + ColorCodes.ORANGE);
                }
                if(Math.random() < 0.04*density) {
                    map.set(LayerCodes.FEATURE, x, y, FeatureCodes.WALL_BRICKS);
                    map.set(LayerCodes.MOBILES, x, y, FeatureCodes.TREE + ColorCodes.LEMONGREEN);
                }
            }
        }
    }