diff options
Diffstat (limited to 'mapGen')
-rw-r--r-- | mapGen/README.md | 89 | ||||
-rw-r--r-- | mapGen/bicolor/Cchamber.jpg (renamed from mapGen/tiles/Cchamber.jpg) | bin | 1278 -> 1278 bytes | |||
-rw-r--r-- | mapGen/bicolor/Ddoor.jpg (renamed from mapGen/tiles/Ddoor.jpg) | bin | 1282 -> 1282 bytes | |||
-rw-r--r-- | mapGen/bicolor/Ggrass.jpg (renamed from mapGen/tiles/Ggrass.jpg) | bin | 1275 -> 1275 bytes | |||
-rw-r--r-- | mapGen/bicolor/Ppassage.jpg (renamed from mapGen/tiles/Ppassage.jpg) | bin | 1286 -> 1286 bytes | |||
-rw-r--r-- | mapGen/bicolor/SsecretDoor.jpg (renamed from mapGen/tiles/SsecretDoor.jpg) | bin | 1280 -> 1280 bytes | |||
-rw-r--r-- | mapGen/bicolor/Xwall-01.jpg (renamed from mapGen/tiles/Xwall.jpg) | bin | 1267 -> 1267 bytes | |||
-rw-r--r-- | mapGen/bicolor/Xwall-02.jpg | bin | 0 -> 1274 bytes | |||
-rw-r--r-- | mapGen/bicolor/Xwall-03.jpg | bin | 0 -> 1272 bytes | |||
-rw-r--r-- | mapGen/bicolor/Xwall-04.jpg | bin | 0 -> 1264 bytes | |||
-rw-r--r-- | mapGen/bicolor/Xwall-05.jpg | bin | 0 -> 1256 bytes | |||
-rw-r--r-- | mapGen/bicolor/Xwall-06.jpg | bin | 0 -> 1267 bytes | |||
-rw-r--r-- | mapGen/bicolor/ofloor-01.jpg (renamed from mapGen/tiles/ofloor.jpg) | bin | 1263 -> 1263 bytes | |||
-rw-r--r-- | mapGen/bicolor/ofloor-02.jpg | bin | 0 -> 1259 bytes | |||
-rw-r--r-- | mapGen/bicolor/ofloor-03.jpg | bin | 0 -> 1262 bytes | |||
-rw-r--r-- | mapGen/bicolor/ofloor-04.jpg | bin | 0 -> 1270 bytes | |||
-rw-r--r-- | mapGen/bicolor/ofloor-05.jpg | bin | 0 -> 1267 bytes | |||
-rw-r--r-- | mapGen/bicolor/ofloor-06.jpg | bin | 0 -> 1270 bytes | |||
-rw-r--r-- | mapGen/bicolor/xwall-01.jpg | bin | 0 -> 1267 bytes | |||
-rw-r--r-- | mapGen/bigmap.dg | 55 | ||||
-rw-r--r-- | mapGen/chamber.xcf | bin | 777 -> 0 bytes | |||
-rw-r--r-- | mapGen/dg/Cfloor.png | bin | 0 -> 598 bytes | |||
-rw-r--r-- | mapGen/dg/Xbricks-01.png | bin | 0 -> 577 bytes | |||
-rw-r--r-- | mapGen/dg/Xbricks-02.png | bin | 0 -> 581 bytes | |||
-rw-r--r-- | mapGen/dg/Xbricks-03.png | bin | 0 -> 585 bytes | |||
-rw-r--r-- | mapGen/dg/ofloor-01a.png | bin | 0 -> 564 bytes | |||
-rw-r--r-- | mapGen/dg/ofloor-01b.png | bin | 0 -> 564 bytes | |||
-rw-r--r-- | mapGen/dg/ofloor-01c.png | bin | 0 -> 564 bytes | |||
-rw-r--r-- | mapGen/dg/ofloor-01d.png | bin | 0 -> 564 bytes | |||
-rw-r--r-- | mapGen/dg/ofloor-01e.png | bin | 0 -> 564 bytes | |||
-rw-r--r-- | mapGen/dg/ofloor-01f.png | bin | 0 -> 564 bytes | |||
-rw-r--r-- | mapGen/dg/ofloor-02.png | bin | 0 -> 567 bytes | |||
-rw-r--r-- | mapGen/dg/ofloor-03.png | bin | 0 -> 583 bytes | |||
-rw-r--r-- | mapGen/dg/ofloor-04.png | bin | 0 -> 594 bytes | |||
-rw-r--r-- | mapGen/dg/ofloor-05.png | bin | 0 -> 589 bytes | |||
-rw-r--r-- | mapGen/dg/ofloor-06.png | bin | 0 -> 577 bytes | |||
-rw-r--r-- | mapGen/door.xcf | bin | 804 -> 0 bytes | |||
-rw-r--r-- | mapGen/examples/cave.jpg | bin | 0 -> 15709 bytes | |||
-rw-r--r-- | mapGen/examples/caveBig.jpg | bin | 0 -> 53939 bytes | |||
-rw-r--r-- | mapGen/examples/map.dg (renamed from mapGen/map.dg) | 4 | ||||
-rw-r--r-- | mapGen/examples/randomMap.dg (renamed from mapGen/randomMap.dg) | 0 | ||||
-rw-r--r-- | mapGen/examples/simple.jpg | bin | 0 -> 1145 bytes | |||
-rw-r--r-- | mapGen/examples/simpleBig.jpg | bin | 0 -> 3360 bytes | |||
-rw-r--r-- | mapGen/examples/tiledDungeon.jpg | bin | 0 -> 37348 bytes | |||
-rw-r--r-- | mapGen/examples/tiledDungeonBig.jpg | bin | 0 -> 123621 bytes | |||
-rw-r--r-- | mapGen/floor.xcf | bin | 723 -> 0 bytes | |||
-rw-r--r-- | mapGen/grass.xcf | bin | 801 -> 0 bytes | |||
-rw-r--r-- | mapGen/greenBlueRedOut.jpg | bin | 16272 -> 0 bytes | |||
-rwxr-xr-x | mapGen/mapGen.sh | 28 | ||||
-rw-r--r-- | mapGen/mapOut.jpg | bin | 263440 -> 0 bytes | |||
-rw-r--r-- | mapGen/out.jpg | bin | 15478 -> 0 bytes | |||
-rw-r--r-- | mapGen/passage.xcf | bin | 795 -> 0 bytes | |||
-rw-r--r-- | mapGen/secretDoor.xcf | bin | 801 -> 0 bytes | |||
-rw-r--r-- | mapGen/wall.xcf | bin | 768 -> 0 bytes |
54 files changed, 117 insertions, 59 deletions
diff --git a/mapGen/README.md b/mapGen/README.md new file mode 100644 index 0000000..66e3363 --- /dev/null +++ b/mapGen/README.md @@ -0,0 +1,89 @@ +# mapGen.sh + +A shellscript to make grid maps from text files + +![Simple map example](examples/simpleBig.jpg) + +``` +xxxxx +xGGxx +xxooG +xxGox +xxxxx +``` + +## Dependencies + +- A POSIX-compliant shell (`bash`, `dash`, `sh`) +- ImageMagick +- Tools expected in a Unix environment: `grep`, `sed`, `awk` + +## Motivation + +The want for Vim to be a map maker. + +## Concept + +Given a text file in which each character represents a cell, have a script draw that map. + +`mapGen.sh` takes as input a text file with a block of text which ideally has a block of characters +with no missing ones. It also takes a folder in which tile images are supposed to be. For each +character in the file, it randomly takes one image in that folder which name starts with that +characters and creates an image from the text file. + +## Examples + +![Cave dungeon example](examples/caveBig.jpg) + +![Tiled dungeon example](examples/tiledDungeonBig.jpg) + +Both images obtained from the same input: + +``` +XXXXXXXXXXXXXXXXXXXX +XXXXXXooooooooXXXXXX +XXXXXXoooooooooXXXXX +XXXXXXooooooooooooXX +XXXXCDooooooooooooDX +XXXXXXooooooooooooXX +XXXXXXooooooooooooXX +XXXXXXoooooooooXXXXX +XXXXXXooooooooXXXXXX +XXXXXXXXXSXXXXXXXXXX +XXXXXXXXooooXXXXXXXX +XXXXXXXooooooXXXXXXX +XXXXXXooooooooXXXXXX +XooooXoooCooooXooooX +XoCooXooooooooXooooX +XooooXooooooooXooooX +XooooXXooooooXXooooX +XooooXXXooooXXXooooX +XooooXXXXooXXXXooooX +XXXoXXXXXooXXXXXooXX +XXXoXXXXooooXXXXooXX +XXXoooooooooooooooXX +XXXXXXooooooooooooXX +XXXXXXXXooooXXXXXXXX +XXXXXXXXXooXXXXXXXXX +XXXXXXXXXooXXXXXXXXX +``` + +## Usage + +``` +mapGen.sh [-s SIZE] [-f TILE_FOLDER] SOURCE_FILE +``` + +Where `SIZE` is the size of the tile images in pixels (default 8), `TILE_FOLDER` is the folder +where the tile images are stored (default `./tiles`) and `SOURCE_FILE` is the text file with the +layout of the map. + +## Possibilities + +The direct mapping of characters in text file to beginning of tile image name gives flexibility to +either choose characters easy to read on the file or to use characters directly taken from the +image names for easier memorization. Either way, the "configuration" of the relationship is +trivial and freely customizable. + +For the examples I used tiles of 8x8 pixels, but other styles could be attained by using bigger +ones. diff --git a/mapGen/tiles/Cchamber.jpg b/mapGen/bicolor/Cchamber.jpg Binary files differindex a325761..a325761 100644 --- a/mapGen/tiles/Cchamber.jpg +++ b/mapGen/bicolor/Cchamber.jpg diff --git a/mapGen/tiles/Ddoor.jpg b/mapGen/bicolor/Ddoor.jpg Binary files differindex 167a16d..167a16d 100644 --- a/mapGen/tiles/Ddoor.jpg +++ b/mapGen/bicolor/Ddoor.jpg diff --git a/mapGen/tiles/Ggrass.jpg b/mapGen/bicolor/Ggrass.jpg Binary files differindex a3f79e6..a3f79e6 100644 --- a/mapGen/tiles/Ggrass.jpg +++ b/mapGen/bicolor/Ggrass.jpg diff --git a/mapGen/tiles/Ppassage.jpg b/mapGen/bicolor/Ppassage.jpg Binary files differindex d21a0e9..d21a0e9 100644 --- a/mapGen/tiles/Ppassage.jpg +++ b/mapGen/bicolor/Ppassage.jpg diff --git a/mapGen/tiles/SsecretDoor.jpg b/mapGen/bicolor/SsecretDoor.jpg Binary files differindex ee974fa..ee974fa 100644 --- a/mapGen/tiles/SsecretDoor.jpg +++ b/mapGen/bicolor/SsecretDoor.jpg diff --git a/mapGen/tiles/Xwall.jpg b/mapGen/bicolor/Xwall-01.jpg Binary files differindex 7d70085..7d70085 100644 --- a/mapGen/tiles/Xwall.jpg +++ b/mapGen/bicolor/Xwall-01.jpg diff --git a/mapGen/bicolor/Xwall-02.jpg b/mapGen/bicolor/Xwall-02.jpg Binary files differnew file mode 100644 index 0000000..e67903e --- /dev/null +++ b/mapGen/bicolor/Xwall-02.jpg diff --git a/mapGen/bicolor/Xwall-03.jpg b/mapGen/bicolor/Xwall-03.jpg Binary files differnew file mode 100644 index 0000000..2eefc61 --- /dev/null +++ b/mapGen/bicolor/Xwall-03.jpg diff --git a/mapGen/bicolor/Xwall-04.jpg b/mapGen/bicolor/Xwall-04.jpg Binary files differnew file mode 100644 index 0000000..816bba1 --- /dev/null +++ b/mapGen/bicolor/Xwall-04.jpg diff --git a/mapGen/bicolor/Xwall-05.jpg b/mapGen/bicolor/Xwall-05.jpg Binary files differnew file mode 100644 index 0000000..0c3f46f --- /dev/null +++ b/mapGen/bicolor/Xwall-05.jpg diff --git a/mapGen/bicolor/Xwall-06.jpg b/mapGen/bicolor/Xwall-06.jpg Binary files differnew file mode 100644 index 0000000..220b228 --- /dev/null +++ b/mapGen/bicolor/Xwall-06.jpg diff --git a/mapGen/tiles/ofloor.jpg b/mapGen/bicolor/ofloor-01.jpg Binary files differindex d79d794..d79d794 100644 --- a/mapGen/tiles/ofloor.jpg +++ b/mapGen/bicolor/ofloor-01.jpg diff --git a/mapGen/bicolor/ofloor-02.jpg b/mapGen/bicolor/ofloor-02.jpg Binary files differnew file mode 100644 index 0000000..18c8dc1 --- /dev/null +++ b/mapGen/bicolor/ofloor-02.jpg diff --git a/mapGen/bicolor/ofloor-03.jpg b/mapGen/bicolor/ofloor-03.jpg Binary files differnew file mode 100644 index 0000000..5fca9da --- /dev/null +++ b/mapGen/bicolor/ofloor-03.jpg diff --git a/mapGen/bicolor/ofloor-04.jpg b/mapGen/bicolor/ofloor-04.jpg Binary files differnew file mode 100644 index 0000000..2c5923b --- /dev/null +++ b/mapGen/bicolor/ofloor-04.jpg diff --git a/mapGen/bicolor/ofloor-05.jpg b/mapGen/bicolor/ofloor-05.jpg Binary files differnew file mode 100644 index 0000000..981a8be --- /dev/null +++ b/mapGen/bicolor/ofloor-05.jpg diff --git a/mapGen/bicolor/ofloor-06.jpg b/mapGen/bicolor/ofloor-06.jpg Binary files differnew file mode 100644 index 0000000..d463804 --- /dev/null +++ b/mapGen/bicolor/ofloor-06.jpg diff --git a/mapGen/bicolor/xwall-01.jpg b/mapGen/bicolor/xwall-01.jpg Binary files differnew file mode 100644 index 0000000..7d70085 --- /dev/null +++ b/mapGen/bicolor/xwall-01.jpg diff --git a/mapGen/bigmap.dg b/mapGen/bigmap.dg deleted file mode 100644 index 26f5289..0000000 --- a/mapGen/bigmap.dg +++ /dev/null @@ -1,55 +0,0 @@ -xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx- -xGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxx -xxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGG --xGGx-xGGx-xGGx-xGGx-xGG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GGx --xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx -xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx- -xGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxx -xxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGG --xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx --xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx -xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx- -xGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxx -xxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGG --xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx --xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx diff --git a/mapGen/chamber.xcf b/mapGen/chamber.xcf Binary files differdeleted file mode 100644 index 2198b9b..0000000 --- a/mapGen/chamber.xcf +++ /dev/null diff --git a/mapGen/dg/Cfloor.png b/mapGen/dg/Cfloor.png Binary files differnew file mode 100644 index 0000000..8e1d600 --- /dev/null +++ b/mapGen/dg/Cfloor.png diff --git a/mapGen/dg/Xbricks-01.png b/mapGen/dg/Xbricks-01.png Binary files differnew file mode 100644 index 0000000..32faade --- /dev/null +++ b/mapGen/dg/Xbricks-01.png diff --git a/mapGen/dg/Xbricks-02.png b/mapGen/dg/Xbricks-02.png Binary files differnew file mode 100644 index 0000000..6918a89 --- /dev/null +++ b/mapGen/dg/Xbricks-02.png diff --git a/mapGen/dg/Xbricks-03.png b/mapGen/dg/Xbricks-03.png Binary files differnew file mode 100644 index 0000000..ae258be --- /dev/null +++ b/mapGen/dg/Xbricks-03.png diff --git a/mapGen/dg/ofloor-01a.png b/mapGen/dg/ofloor-01a.png Binary files differnew file mode 100644 index 0000000..b6b44f4 --- /dev/null +++ b/mapGen/dg/ofloor-01a.png diff --git a/mapGen/dg/ofloor-01b.png b/mapGen/dg/ofloor-01b.png Binary files differnew file mode 100644 index 0000000..b6b44f4 --- /dev/null +++ b/mapGen/dg/ofloor-01b.png diff --git a/mapGen/dg/ofloor-01c.png b/mapGen/dg/ofloor-01c.png Binary files differnew file mode 100644 index 0000000..b6b44f4 --- /dev/null +++ b/mapGen/dg/ofloor-01c.png diff --git a/mapGen/dg/ofloor-01d.png b/mapGen/dg/ofloor-01d.png Binary files differnew file mode 100644 index 0000000..b6b44f4 --- /dev/null +++ b/mapGen/dg/ofloor-01d.png diff --git a/mapGen/dg/ofloor-01e.png b/mapGen/dg/ofloor-01e.png Binary files differnew file mode 100644 index 0000000..b6b44f4 --- /dev/null +++ b/mapGen/dg/ofloor-01e.png diff --git a/mapGen/dg/ofloor-01f.png b/mapGen/dg/ofloor-01f.png Binary files differnew file mode 100644 index 0000000..b6b44f4 --- /dev/null +++ b/mapGen/dg/ofloor-01f.png diff --git a/mapGen/dg/ofloor-02.png b/mapGen/dg/ofloor-02.png Binary files differnew file mode 100644 index 0000000..74f153a --- /dev/null +++ b/mapGen/dg/ofloor-02.png diff --git a/mapGen/dg/ofloor-03.png b/mapGen/dg/ofloor-03.png Binary files differnew file mode 100644 index 0000000..c513efb --- /dev/null +++ b/mapGen/dg/ofloor-03.png diff --git a/mapGen/dg/ofloor-04.png b/mapGen/dg/ofloor-04.png Binary files differnew file mode 100644 index 0000000..c1303b4 --- /dev/null +++ b/mapGen/dg/ofloor-04.png diff --git a/mapGen/dg/ofloor-05.png b/mapGen/dg/ofloor-05.png Binary files differnew file mode 100644 index 0000000..0af94be --- /dev/null +++ b/mapGen/dg/ofloor-05.png diff --git a/mapGen/dg/ofloor-06.png b/mapGen/dg/ofloor-06.png Binary files differnew file mode 100644 index 0000000..13b36d1 --- /dev/null +++ b/mapGen/dg/ofloor-06.png diff --git a/mapGen/door.xcf b/mapGen/door.xcf Binary files differdeleted file mode 100644 index fa1cc1a..0000000 --- a/mapGen/door.xcf +++ /dev/null diff --git a/mapGen/examples/cave.jpg b/mapGen/examples/cave.jpg Binary files differnew file mode 100644 index 0000000..727366e --- /dev/null +++ b/mapGen/examples/cave.jpg diff --git a/mapGen/examples/caveBig.jpg b/mapGen/examples/caveBig.jpg Binary files differnew file mode 100644 index 0000000..802c975 --- /dev/null +++ b/mapGen/examples/caveBig.jpg diff --git a/mapGen/map.dg b/mapGen/examples/map.dg index 7da4706..54e3ba8 100644 --- a/mapGen/map.dg +++ b/mapGen/examples/map.dg @@ -1,5 +1,5 @@ xxxxx xGGxx -xxaaG -xxGax +xxooG +xxGox xxxxx diff --git a/mapGen/randomMap.dg b/mapGen/examples/randomMap.dg index 2ead560..2ead560 100644 --- a/mapGen/randomMap.dg +++ b/mapGen/examples/randomMap.dg diff --git a/mapGen/examples/simple.jpg b/mapGen/examples/simple.jpg Binary files differnew file mode 100644 index 0000000..1f616ad --- /dev/null +++ b/mapGen/examples/simple.jpg diff --git a/mapGen/examples/simpleBig.jpg b/mapGen/examples/simpleBig.jpg Binary files differnew file mode 100644 index 0000000..2b58279 --- /dev/null +++ b/mapGen/examples/simpleBig.jpg diff --git a/mapGen/examples/tiledDungeon.jpg b/mapGen/examples/tiledDungeon.jpg Binary files differnew file mode 100644 index 0000000..141371a --- /dev/null +++ b/mapGen/examples/tiledDungeon.jpg diff --git a/mapGen/examples/tiledDungeonBig.jpg b/mapGen/examples/tiledDungeonBig.jpg Binary files differnew file mode 100644 index 0000000..b017888 --- /dev/null +++ b/mapGen/examples/tiledDungeonBig.jpg diff --git a/mapGen/floor.xcf b/mapGen/floor.xcf Binary files differdeleted file mode 100644 index a83e4c2..0000000 --- a/mapGen/floor.xcf +++ /dev/null diff --git a/mapGen/grass.xcf b/mapGen/grass.xcf Binary files differdeleted file mode 100644 index 3b11c90..0000000 --- a/mapGen/grass.xcf +++ /dev/null diff --git a/mapGen/greenBlueRedOut.jpg b/mapGen/greenBlueRedOut.jpg Binary files differdeleted file mode 100644 index 7448cc8..0000000 --- a/mapGen/greenBlueRedOut.jpg +++ /dev/null diff --git a/mapGen/mapGen.sh b/mapGen/mapGen.sh index 1be77f7..bf4bac3 100755 --- a/mapGen/mapGen.sh +++ b/mapGen/mapGen.sh @@ -3,13 +3,37 @@ # mapGen.sh # # Generate a map with ImageMagick from an input text file +# +# Usage: mapGen.sh [-s SIZE] [-f TILE_FOLDER] SOURCE_FILE -inputFile="$1" +usageMsg="Usage: mapGen.sh [-s SIZE] [-f TILE_FOLDER] SOURCE_FILE" cellSize=8 tilesDir="./tiles" +while echo "$1" | grep '^-' >/dev/null; do + case "$1" in + "-s") + [ -z "$2" ] && echo "Missing argument for -s. $usageMsg" >&2 && exit 1 + cellSize="$2" + shift 2 + ;; + "-f") + [ -z "$2" ] && echo "Missing argument for -f. $usageMsg" >&2 && exit 1 + tilesDir="$2" + shift 2 + ;; + esac +done + +[ -z "$1" ] && echo "$usageMsg" >&2 && exit 1 + +inputFile="$1" + +[ ! -f "$inputFile" ] && echo "File not found: $inputFile" >&2 && exit 1 +[ ! -d "$tilesDir" ] && echo "Directory not found: $tilesDir" >&2 && exit 1 + height="$(wc -l <"$inputFile")" width="$(awk '{print length($0)}' "$inputFile" | sort -nr | sed 1q)" @@ -26,7 +50,7 @@ col=0 while read line; do echo "$line" | ( while read -n1 char; do - tileFile="$(find $tilesDir | sed 's|.*/||' | grep "^$char")" + tileFile="$(find $tilesDir | sed 's|.*/||' | grep "^$char" | shuf | sed 1q)" tileFile="${tilesDir}/${tileFile}" echo "$tileFile" | wc -l | grep 1 >/dev/null || continue convert out.jpg "$tileFile" -geometry +"$col"+"$row" -composite out.jpg || diff --git a/mapGen/mapOut.jpg b/mapGen/mapOut.jpg Binary files differdeleted file mode 100644 index 7067c52..0000000 --- a/mapGen/mapOut.jpg +++ /dev/null diff --git a/mapGen/out.jpg b/mapGen/out.jpg Binary files differdeleted file mode 100644 index d4a3964..0000000 --- a/mapGen/out.jpg +++ /dev/null diff --git a/mapGen/passage.xcf b/mapGen/passage.xcf Binary files differdeleted file mode 100644 index 926783a..0000000 --- a/mapGen/passage.xcf +++ /dev/null diff --git a/mapGen/secretDoor.xcf b/mapGen/secretDoor.xcf Binary files differdeleted file mode 100644 index 6963426..0000000 --- a/mapGen/secretDoor.xcf +++ /dev/null diff --git a/mapGen/wall.xcf b/mapGen/wall.xcf Binary files differdeleted file mode 100644 index e1cc359..0000000 --- a/mapGen/wall.xcf +++ /dev/null |