Files
cell/scripts/modules/dull.js
John Alanbrook 566baa250c
Some checks failed
Build and Deploy / package-dist (push) Has been cancelled
Build and Deploy / deploy-itch (push) Has been cancelled
Build and Deploy / deploy-gitea (push) Has been cancelled
Build and Deploy / build-linux (push) Has been cancelled
Build and Deploy / build-windows (CLANG64) (push) Has been cancelled
sdl renderer
'
2025-04-13 21:32:34 -05:00

54 lines
931 B
JavaScript

/*
the "dull" game engine
This sets up a lot of different modules to be used altogether
*/
var render = use('render')
var layout = use('clay')
var input = use('input')
var emitter = use('emitter')
var os = use('os')
var imgui = use('imgui')
var tracy = use('tracy')
var last_frame_time = 0
var timescale = 1
last_frame_time = os.now()
function step() {
var now = os.now()
var dt = now - last_frame_time
last_frame_time = now
// event.engine_input(e => prosperon.dispatch(e.type, e))
layout.newframe()
prosperon.appupdate(dt)
input.procdown()
emitter.update(dt * timescale)
prosperon.update(dt * timescale)
render.setup_draw()
render.setup_hud()
if (imgui) imgui.prosperon_menu();
// Now do the GPU present (calls gpupresent in render.js)
render.present()
tracy.end_frame()
}
function start()
{
}
// Return or export them so you can call from a main script
return {
start,
step
}