Add camera edge clamping
This commit is contained in:
parent
84eadde101
commit
125b3c7897
|
@ -141,7 +141,7 @@ export function GameState(ctx: ContextI): StateI {
|
|||
entity.act(desiredActions)
|
||||
// FIXME: This isn't the right place for this.
|
||||
rootContainer.position.set(Math.round(ctx.app.renderer.width/2), Math.round(ctx.app.renderer.height/2))
|
||||
rootContainer.pivot.set(entity.x, entity.y)
|
||||
rootContainer.pivot.set(Math.max(rootContainer.width/6, Math.min(entity.x, rootContainer.width/3)), Math.max(rootContainer.height/6, Math.min(entity.y, rootContainer.height/3)))
|
||||
}
|
||||
entity.update(delta)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user