| 168 | } |
| 169 | |
| 170 | const getPosition = e => { |
| 171 | const _y = (e.offsetY - tileHeight * 2) / tileHeight |
| 172 | const _x = e.offsetX / tileWidth - ntiles / 2 |
| 173 | x = Math.floor(_y - _x) |
| 174 | y = Math.floor(_x + _y) |
| 175 | return { x, y } |
| 176 | } |
| 177 | |
| 178 | const viz = (e) => { |
| 179 | if (isPlacing) |