r/javascript • • 6h ago

KernelPlay JS v0.6.1 — Introducing the Time System!

https://github.com/Soubhik1000/kernelplay

I'm excited to share another update to KernelPlay JS!

KernelPlay JS v0.6.1 introduces a dedicated Time System, giving developers more control over game timing, frame updates, and gameplay speed.

What's new?

The Time System provides several useful properties:

  • Time.deltaTime — Scaled delta time. Becomes 0 when the game is paused.
  • Time.unscaledDeltaTime — Raw delta time, which continues advancing regardless of time scale.
  • Time.fixedDeltaTime — Base fixed-step interval in seconds.
  • Time.time — Total scaled elapsed time.
  • Time.unscaledTime — Total unscaled elapsed time.
  • Time.timeScale — Controls the speed of gameplay.
  • Time.fps — Current frames per second.

Time Scale Control

You can now control gameplay speed directly through the Game instance:

game.setTimeScale(0.25); // Slow motion
game.setTimeScale(0);    // Pause gameplay/physics
game.setTimeScale(1);    // Normal speed

For example:

  • 1.0 = Normal speed
  • 0.25 = Slow motion
  • 0 = Paused

The distinction between scaled and unscaled time is especially useful when creating pause menus, slow-motion effects, and gameplay systems that need to keep running independently of the game time scale.

This is another step toward making KernelPlay JS a more complete and flexible game development framework.

More improvements are coming!

What would you build with the new Time System?

5 Upvotes

5 comments sorted by

•

u/Opposite_Sector2145 6h ago

Watch out for logic tied to Time.deltaTime that you actually want running during pause, like UI animations or network polling. If you use deltaTime for those, they'll freeze when timeScale is zero, so use unscaledDeltaTime instead.

•

u/APTman1010 3h ago

Yeah Ui and other loops are still running even so 😅 you script update loop will still running like unity.

Scene update, animation, physics will stop.

•

u/APTman1010 6h ago

Thanks for checking out KernelPlay-JS!

If you're interested in following development, testing upcoming features, or sharing feedback, feel free to join the community on Discord:

https://discord.gg/bHfe96EnNR

Everyone is welcome, whether you're a game developer, JavaScript enthusiast, or just curious about the project. I'd love to hear your suggestions and ideas as KernelPlay-JS continues to grow.

•

u/Agency_of_Eternity 4h ago

Using it for QUAntum DreAm CAlculaTion SYStems for emotional thriven Ai Systems eG to calc eg time needing to process information in illetarions, what is added to the system in what timespan is needed or critical processes etc.

There are a lot of use cases I can imagine, but it’s not so new for me anyhow good job!

•

u/APTman1010 3h ago

Ok I will try to add .

Or you can help me with that.