diff --git a/Box b/Box index 5e25fdd..d1359cd 160000 --- a/Box +++ b/Box @@ -1 +1 @@ -Subproject commit 5e25fdd1f5a9ec883e6062d4c67b06a4d6df72f3 +Subproject commit d1359cd1f893fa4a4e53a29b4a0797abd444dca7 diff --git a/assets/scripts/tilemap/generator.toy b/assets/scripts/tilemap/generator.toy index aec4fed..6da38fc 100644 --- a/assets/scripts/tilemap/generator.toy +++ b/assets/scripts/tilemap/generator.toy @@ -149,8 +149,7 @@ fn etchRoom(rng: opaque, metadata: [string: any]) { for (var j: int = y; j < y + h; j++) { for (var i: int = x; i < x + w; i++) { var ITERATION: int const = j * MAP_GRID_WIDTH * 3 + i * 3; - var r = rng.generateRandomNumber() % 4; //BUG: see Toy#67 - var floorIndex: string const = theme + "-floor-" + string r; //NOTE: there might not always be only 4 floor sprites + var floorIndex: string const = theme + "-floor-" + string(rng.generateRandomNumber() % 4); //NOTE: there might not always be only 4 floor sprites tilemap[ITERATION + 0] = tileset[floorIndex][0]; tilemap[ITERATION + 1] = tileset[floorIndex][1]; tilemap[ITERATION + 2] = tileset[floorIndex][2]; @@ -359,8 +358,7 @@ fn etchLine(x: int, y: int, xLength: int, yLength: int, theme: string, rng: opaq while (abs(xLength) > 0 || abs(yLength) > 0) { //etch floor at this position var ITERATION: int const = y * MAP_GRID_WIDTH * 3 + x * 3; - var r = rng.generateRandomNumber() % 4; - var floorIndex: string const = theme + "-floor-" + string r; //NOTE: there might not always be only 4 floor sprites + var floorIndex: string const = theme + "-floor-" + string(rng.generateRandomNumber() % 4); //NOTE: there might not always be only 4 floor sprites tilemap[ITERATION + 0] = tileset[floorIndex][0]; tilemap[ITERATION + 1] = tileset[floorIndex][1]; tilemap[ITERATION + 2] = tileset[floorIndex][2];