ct.flow, ct.u.wait, ct.tween should operate based on ct.delta, with optional setTimeout mode
See original GitHub issueDescribe 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 argumentignoreDelta
.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@naturecodevoid, sure! I now think, though, that there should be pairs of methods instead of methods with additional options (
ct.tween.add
andct.tween.addUi
, for example), as it will be more readable and and uniform compared to existing methods in ct.mouse and ct.touch.@naturecodevoid better expand ct.js’ core library, as timers are pretty essential to gamemaking