Skip to content
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

Cat Rain w/ Web Animation API #1

Merged
merged 1 commit into from
Dec 23, 2024
Merged

Conversation

Martin-Pitt
Copy link
Owner

Use the Web Animation API for cat rain instead.

rAF loops run at 120Hz on, well, 120Hz displays, so the cats end up falling and spinning twice as fast.

Now imagine how that feels like on a 240Hz display.

You can fix that by using delta time in the rAF animation loops but there is the Web Animation API which also animates it off the main thread and other good stuff.

Use the Web Animation API for cat rain instead

rAF loops run at 120Hz on, well, 120Hz displays, so the cats end up falling and spinning twice as fast. Now imagine how that felt like on a 240Hz display.
@Martin-Pitt Martin-Pitt changed the title Update main.js Cat Rain w/ Web Animation API Dec 23, 2024
@Martin-Pitt Martin-Pitt merged commit b345f75 into main Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant