fix: sturdy walls

This commit is contained in:
cha0s 2019-04-28 22:43:24 -05:00
parent e13c8dfc66
commit ebf3d2dc28

View File

@ -132,22 +132,22 @@ export class Room extends decorate(class {}) {
// Top.
world.createBody((new RectangleShape()).fromJSON({
position: [this.width / 2, -HALF_ROOM_BOUND_SIZE],
size: [this.width, ROOM_BOUND_SIZE],
size: [this.width + ROOM_BOUND_SIZE, ROOM_BOUND_SIZE],
})),
// Right.
world.createBody((new RectangleShape()).fromJSON({
position: [this.width + HALF_ROOM_BOUND_SIZE, this.height / 2],
size: [ROOM_BOUND_SIZE, this.height],
size: [ROOM_BOUND_SIZE, this.height + ROOM_BOUND_SIZE],
})),
// Bottom.
world.createBody((new RectangleShape()).fromJSON({
position: [this.width / 2, this.height + HALF_ROOM_BOUND_SIZE],
size: [this.width, ROOM_BOUND_SIZE],
size: [this.width + ROOM_BOUND_SIZE, ROOM_BOUND_SIZE],
})),
// Left.
world.createBody((new RectangleShape()).fromJSON({
position: [-HALF_ROOM_BOUND_SIZE, this.height / 2],
size: [ROOM_BOUND_SIZE, this.height],
size: [ROOM_BOUND_SIZE, this.height + ROOM_BOUND_SIZE],
})),
];
this.bounds.forEach((bound) => {