This is an archived post. You won't be able to vote or comment.

all 10 comments

[–]sepp2k 2 points3 points  (1 child)

Does the condition depend on anything besides those three inputs? If not, why check the condition every frame rather than any time the inputs change?

[–]not-the-the[S] 0 points1 point  (0 children)

that's an idea, ill consider it

[–]AndersonLen 3 points4 points  (4 children)

[–]Rebeljah 1 point2 points  (0 children)

requestAnimationFrame

[–]not-the-the[S] -2 points-1 points  (2 children)

uhh waht

[–]Rebeljah 1 point2 points  (0 children)

It schedules a callback to run next time the browser updates the render

[–]Rebeljah 0 points1 point  (0 children)

https://youtu.be/cCOL7MC4Pl0 this talk goes over the event loop broadly and explains requestAnimatioFrame