Boilerplate and tooling for authoring modern web applications with Hyperapp and Node.js.
Render Hyperapp to an HTML string with SSR and Node.js streaming support.
The web's most popular Jamstack front-end template (boilerplate) for building web applications with React
A simple middleware-style router for isomorphic JavaScript web apps
Thank you for the quick response! console-extras.js is cool, did not know about it, thanks!
I was looking for a way to execute something every game second and not just every real clock second. For example if the system will freeze for 5 seconds, mainLoop will execute update function (5 * fps) times while a single tick. The game timer should execute every (1 * fps) update call, i.e. 5 times in total and not just once as in your example.
Maybe the solution should look something like this instead, what do you think?
let timer = 0
let delay = 0
function update(dt) {
timer += dt
if (timer >= delay) {
delay += 1000
// do whatever you want here
}
}
For example I need to perform a specific action every game second:
function update(dt) {
if (/* what to check here? */) {
console.log('this message is logged every second')
}
}