summaryrefslogtreecommitdiff
path: root/index.js
blob: e43c3f237dd7250b1bf3dd2318c2ad2203cc70ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { Engine } from "./src/engine.js"
Engine.startEngine()

// import { start, update, draw } from "./src/main.js";
// const fps = 60
// 
// 
// /* cap the game's fps */
// let msPrev = window.performance.now()
// const msPerFrame = 1000 / fps
// let frames = 0
// function gameloop() {
//     window.requestAnimationFrame(gameloop)
//     
//     const msNow = window.performance.now()
//     const msPassed = msNow - msPrev
//     
//     if (msPassed < msPerFrame) return
//     
//     const excessTime = msPassed % msPerFrame
//     msPrev = msNow - excessTime
//     
//     frames++
// 
//     update()
//     draw()
// }
// 
// /* call functions to start the game */
// /* the game logic can be found in src */
// start()
// gameloop()