Comments (3)
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.
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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cavernos.