-
-
Notifications
You must be signed in to change notification settings - Fork 191
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
feat: [#577] [#1170] Implement new Clock API #2122
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eonarheim
added
the
work-in-progress
A work in progress pull request, will not be merged until this is removed
label
Nov 23, 2021
github-actions
bot
added
the
enhancement
Label applied to enhancements or improvements to existing features
label
Nov 23, 2021
eonarheim
changed the title
feat: Implement
feat: [#577] [#1170] Implement new Clock API
Nov 23, 2021
maxFps
Engine option
eonarheim
removed
the
work-in-progress
A work in progress pull request, will not be merged until this is removed
label
Nov 24, 2021
eonarheim
added
the
work-in-progress
A work in progress pull request, will not be merged until this is removed
label
Nov 25, 2021
I want to have the tests moved over to the TestClock before merging, should speed up the test runs |
eonarheim
commented
Nov 27, 2021
eonarheim
commented
Nov 27, 2021
eonarheim
commented
Nov 27, 2021
eonarheim
removed
the
work-in-progress
A work in progress pull request, will not be merged until this is removed
label
Nov 27, 2021
55 tasks
jedeen
reviewed
Nov 28, 2021
jedeen
reviewed
Nov 28, 2021
jedeen
approved these changes
Nov 28, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
===:clipboard: PR Checklist :clipboard:===
==================
Closes: #1170
Closes: #577
This PR implements a new Clock api to manage the core main loop. Clocks hide the implementation detail of how the mainloop runs, users just knows that it ticks somehow. Clocks additionally encapsulate any related browser timing, like
performance.now()
StandardClock
encapsulates the existingrequestAnimationFrame
api logicTestClock
allows a user to manually step the mainloop, this can be useful for frame by frame debugging Add Engine frame step debugging feature #1170maxFps
option is added to the engine constructor options. This is achieved by exiting the mainloop early in clock if the current elapsed time does not match the desired fps. This can be useful when you want to deliver a consistent experience across devices.Some fixed bugs that were illuminated as part of this
Current game start flow
After this PR (consolidate init before start resolves)
Before
Changes:
maxFps
engine option to constrain to a maximum fps