refactor: stage takes camera

This commit is contained in:
cha0s 2019-04-19 00:04:40 -05:00
parent 74924f97ea
commit bb9b033603

View File

@ -81,9 +81,7 @@ room.on('entityAdded', (entity) => {
entity.addTrait(type);
}
const {camera} = entity;
camera.on('realPositionChanged', () => {
roomView.position = Vector.scale(selfEntity.camera.realOffset, -1);
});
stage.camera = camera;
// Avoid the initial 'lerp.
camera.realPosition = camera.position;
}