New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding GameTime. Time since app start that pauses with director. #101
Conversation
Minor other fixes.
This change also includes a change to node.js to skip updating hidden objects. The caller to update also doesn't force the dirty_ flag to 0 after calling update for two reasons. 1: update already did this. and 2: this allows the skip of hidden elements to be safer because they will still be dirty when they are ever shown again. |
* Get Game Time | ||
* Time since app start that does not advance while paused. | ||
*/ | ||
lime.scheduleManager.GetGameTime = function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
camelCase
I'll make the recommended fixes and create another pull request tonight. |
You can just commit your changes to the same branch and this page will pick it up. |
…ile game is paused.
Per your request I tested delta vs getGameTime. they are off by about 460ms to start, probably because my delta function doesn't schedule itself early enough. After that, pausing and resuming seem to cause a difference of about 2ms in delta's favor. Also, calls to lime.updateDirtyObjects() which I call on window resize while the pause screen is open seems to add 1-3ms to delta, and not to getGameTime. Probably a matter of preference on which is "correct". |
That is a problem. Not sure what causes the difference but maybe we should use a different technique then and sum up all the deltas in schedulemanager. |
Ok, I can change it to also use sum. Btw, I wouldn't be offended if you just don't want this change. I can move it out of director and into some other global for my local game. It doesn't have to be part of limejs if you don't like it. |
…eTime() with my own global TD.getGameTime() and I now track this outside of limeJS.
Closing this now because there doesn't seem to be any |
getGameTime will return ms since app start, and won't increment when the app is paused.
Useful for replacing goog.now() calls or Date.now() calls for time path, while preventing pause-cheats.
Minor other fixes.