silphius/public/assets/hoe/projection-check.js
2024-07-12 17:41:55 -05:00

16 lines
310 B
JavaScript

const layer0 = ecs.get(1).TileLayers.layer(0)
const layer1 = ecs.get(1).TileLayers.layer(1)
const filtered = []
for (const position of projected) {
if (
[1, 2, 3, 4, 6].includes(layer0.tile(position))
&& ![7].includes(layer1.tile(position))
) {
filtered.push(position)
}
}
return filtered