Setup formatting
This commit is contained in:
parent
d34f25295c
commit
dd850d11d1
45 changed files with 230 additions and 190 deletions
|
|
@ -23,12 +23,12 @@ export class Camera extends GameObject {
|
|||
|
||||
this._viewArea.topLeft = vec2.fromValues(
|
||||
this.center.x - this._viewArea.size.x / 2,
|
||||
this.center.y + this._viewArea.size.y / 2
|
||||
this.center.y + this._viewArea.size.y / 2,
|
||||
);
|
||||
|
||||
this._viewArea.size = vec2.fromValues(
|
||||
Math.sqrt(Camera.inViewAreaSize * canvasAspectRatio),
|
||||
Math.sqrt(Camera.inViewAreaSize / canvasAspectRatio)
|
||||
Math.sqrt(Camera.inViewAreaSize / canvasAspectRatio),
|
||||
);
|
||||
|
||||
c.renderer.setViewArea(this._viewArea.topLeft, this._viewArea.size);
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ export class GameObjectContainer extends CommandReceiver {
|
|||
this.addObject(this.camera);
|
||||
},
|
||||
|
||||
[StepCommand.type]: (c: StepCommand) => {
|
||||
[StepCommand.type]: (_: StepCommand) => {
|
||||
if (this.player) {
|
||||
this.camera.center = this.player.position;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue