Use Polygon

This commit is contained in:
Ketchetwahmeegwun T. Southall 2022-01-29 23:02:52 -08:00
parent 8f8519e19b
commit d82e18288c

View File

@ -255,7 +255,7 @@ export function GameState(ctx: ContextI): StateI {
// Zonage
let addZone = (zone: Zone) => {
if (zones.find(v=>v===zone)) return
let shape = planck.Chain(zone.points.map(v=>planck.Vec2(v[0],v[1])))
let shape = planck.Polygon(zone.points.map(v=>planck.Vec2(v[0],v[1])))
zone.fixture = worldBody.createFixture({
shape: shape,
})