question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ct.flow, ct.u.wait, ct.tween should operate based on ct.delta, with optional setTimeout mode

See original GitHub issue

Describe the current state of the problem ct.flow, ct.tween and the built-in method ct.u.wait all work with time. Internally, they use setTimeout, which is good for UI and most gameplay-related cases, but will fail if a game developer uses slo-mo effects or has, in the opposite, time acceleration controls (a la Sims), as these change ct.delta on which is based all the ct.js’ logic.

Describe the solution you’d like

All time-based methods should work with ct.delta by default. Optional parameters should be present to enable the old behavior, as it is needed for UI and other events that are off the main game loop. I think it is safe to name all these cases as UI actions.

For example:

  • ct.tween.add gets a new parameter in its options, ignoreDelta;
  • ct.flow.timer and others get an optional argument ignoreDelta.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
CosmoMyzrailGorynychcommented, Apr 5, 2020

@naturecodevoid, sure! I now think, though, that there should be pairs of methods instead of methods with additional options (ct.tween.add and ct.tween.addUi, for example), as it will be more readable and and uniform compared to existing methods in ct.mouse and ct.touch.

0reactions
CosmoMyzrailGorynychcommented, Apr 11, 2020

Edit: Would you mind if I try to create ct.timer?

@naturecodevoid better expand ct.js’ core library, as timers are pretty essential to gamemaking

Read more comments on GitHub >

github_iconTop Results From Across the Web

Changelog - Ct.js
Changelog of ct.js, a free 2D game editor based on web technologies. ... ct.flow, ct.u.wait, ct.tween now operate based on ct.delta, with optional...
Read more >
Scheduling: setTimeout and setInterval
setInterval allows us to run a function repeatedly, starting after the interval of time, then repeating continuously at that interval.
Read more >
Controls Operation and Troubleshooting - Carrier
The guide vane is a variable flow pre-whirl assembly that controls the refrigeration effect in the cooler by regulating the amount of refrigerant...
Read more >
Controls, Start-Up, Operation, Service and Troubleshooting
Operating Modes. ... would scroll through the modes and sub-modes using the and ... Ct .01. Circuit A Welded Contactor. Failure. Controls determine...
Read more >
Start-Up, Operation, and Maintenance Instructions - Carrier
The 19XR chiller may be equipped with a wye-delta starter mounted on the unit. ... CT. — Current Transformer. ECW. — Entering Chilled...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found