about summary refs log tree commit diff stats
path: root/html/rogue/js/state.js
blob: f5c713ddf3055703161e29ccc67afc928b94b9b6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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);
    }
};