frenzzy
Repos
102
Followers
152
Following
68

Boilerplate and tooling for authoring modern web applications with Hyperapp and Node.js.

60
8

Render Hyperapp to an HTML string with SSR and Node.js streaming support.

97
13

The web's most popular Jamstack front-end template (boilerplate) for building web applications with React

21704
3960

A simple middleware-style router for isomorphic JavaScript web apps

1633
100

JavaScript Style Guide

131303
22211

Minesweeper game written in Hyperapp.js

34
2

Events

started
Created at 5 days ago
Created at 1 week ago
issue comment
The right way to use fps insensitive timeout or interval timers

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
  }
}
Created at 2 weeks ago
The right way to use fps insensitive timeout or interval timers

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')
  }
}
Created at 2 weeks ago
Created at 3 weeks ago
Created at 3 weeks ago
started
Created at 1 month ago
Created at 2 months ago
frenzzy create branch main
Created at 2 months ago
frenzzy create repository
Created at 2 months ago
frenzzy create branch main
Created at 2 months ago
frenzzy create repository
Created at 2 months ago
frenzzy create branch main
Created at 2 months ago
frenzzy create repository
Created at 2 months ago
frenzzy create branch main
Created at 2 months ago
frenzzy create repository
Created at 2 months ago
started
Created at 2 months ago
frenzzy create branch main
Created at 2 months ago