const GameState = { canvas: null, ctx: null, lastFrameTime: 0, init() { this.canvas = document.getElementById('gameCanvas'); this.ctx = this.canvas.getContext('2d'); this.lastFrameTime = 0; }, resize() { this.canvas.width = window.innerWidth; this.canvas.height = window.innerHeight; Camera.centerOn(player.position); } };