Use Polygon
This commit is contained in:
parent
8f8519e19b
commit
d82e18288c
|
@ -255,7 +255,7 @@ export function GameState(ctx: ContextI): StateI {
|
||||||
// Zonage
|
// Zonage
|
||||||
let addZone = (zone: Zone) => {
|
let addZone = (zone: Zone) => {
|
||||||
if (zones.find(v=>v===zone)) return
|
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({
|
zone.fixture = worldBody.createFixture({
|
||||||
shape: shape,
|
shape: shape,
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue
Block a user