diff options
author | niliara-edu <nil.jimeno@estudiant.fjaverianas.com> | 2024-12-23 18:32:29 +0100 |
---|---|---|
committer | niliara-edu <nil.jimeno@estudiant.fjaverianas.com> | 2024-12-23 18:32:29 +0100 |
commit | a840990bdcabf45fb0d377478ba0ab27222434ae (patch) | |
tree | 030a6c3a6befce284733f5643d3972e3a1504bb2 /index.js |
initial commit
Diffstat (limited to 'index.js')
-rw-r--r-- | index.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/index.js b/index.js new file mode 100644 index 0000000..e43c3f2 --- /dev/null +++ b/index.js @@ -0,0 +1,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() |