fix bad shape generation
This commit is contained in:
parent
b6a3cfd8ba
commit
af5364155f
1 changed files with 3 additions and 3 deletions
|
|
@ -142,14 +142,14 @@ function determinePuzzleTileShapes(info) {
|
||||||
const shapes = new Array(info.tiles)
|
const shapes = new Array(info.tiles)
|
||||||
for (let i = 0; i < info.tiles; i++) {
|
for (let i = 0; i < info.tiles; i++) {
|
||||||
let coord = Util.coordByTileIdx(info, i)
|
let coord = Util.coordByTileIdx(info, i)
|
||||||
shapes[i] = Util.encodeShape({
|
shapes[i] = {
|
||||||
top: coord.y === 0 ? 0 : shapes[i - info.tilesX].bottom * -1,
|
top: coord.y === 0 ? 0 : shapes[i - info.tilesX].bottom * -1,
|
||||||
right: coord.x === info.tilesX - 1 ? 0 : Util.choice(tabs),
|
right: coord.x === info.tilesX - 1 ? 0 : Util.choice(tabs),
|
||||||
left: coord.x === 0 ? 0 : shapes[i - 1].right * -1,
|
left: coord.x === 0 ? 0 : shapes[i - 1].right * -1,
|
||||||
bottom: coord.y === info.tilesY - 1 ? 0 : Util.choice(tabs),
|
bottom: coord.y === info.tilesY - 1 ? 0 : Util.choice(tabs),
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
return shapes
|
return shapes.map(Util.encodeShape)
|
||||||
}
|
}
|
||||||
|
|
||||||
const determineTilesXY = (w, h, targetTiles) => {
|
const determineTilesXY = (w, h, targetTiles) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue