import canvas2d from './cgt/utils/canvas2d'
import looper from './cgt/utils/looper'
import sceneManager from './scenes'

if (false && 'serviceWorker' in navigator) {
    navigator.serviceWorker.register('./service-worker.js')
}

const ctx = canvas2d(
    document.getElementById('canvas'), {
        autoresize: false
    }
)

looper(dt => {
    sceneManager.update(dt)

    ctx.fillStyle = '#000'
    ctx.fillRect(0, 0, 160, 144)

    sceneManager.draw(ctx)
})
