GithubHelp home page GithubHelp logo

Comments (3)

jordwest avatar jordwest commented on May 1, 2024 1

Let me clarify a bit. The pause button is really more of a debug tool. It's not intended for a user to pause a game, rather it's pausing execution of the webassembly. If a game for example wants a pause function for users to press, it can implement that itself with some user interaction.

Since it's just a debug tool, I don't really want to add some special logic to handle that pause button differently than hiding the browser tab. I'll most likely remove the button in production builds at some point anyway.

from cavernos.

jordwest avatar jordwest commented on May 1, 2024

Ah, are you sure it's the RNG seed?

It probably looks like this because the frame function gets passed the dt - delta time - since the last frame. Because in the example this delta time is used to increment the position of the noise, if it has been several seconds since the last frame (like after frames have been paused for a few seconds) then the noise position is incremented by a bigger jump so it appears like a different texture. But if you pause for shorter periods, you'll see that it only jumps a little.

Applications will need to deal with this on their own if they're dependent on that time - as it can happen without pausing too. For example, if the user hides the tab in their browser, the browser will stop animating and thus we won't be calling the frame function. It's up to the app to decide whether to discard large chunks of time between frames or not.

from cavernos.

Zireael07 avatar Zireael07 commented on May 1, 2024

IMHO incrementing dt when paused is definitely going to be seen as buggy. We can't affect the behavior when hiding the tab, but incrementing dt when paused is just... not done.

from cavernos.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.