Game loop in Vue
Posted on
by Kevin FoongHere is how to do a game or animation loop in Vue using Javascript's "requestAnimationFrame" method.
So what is requestAnimationFrame?
requestAnimationFrame
is a method that is part of the very large Web API's under the Window Interface. See this page for more information - https://developer.mozilla.org/en-US/docs/Web/API/Window/requestAnimationFrame
This method provides a callback, typically to the function it is in, to create a recursive loop that can achieve up to 60 frames per second. I've created a very simple growing box animation in Vue to demonstrate.
Read more ...
Tags: games Vue Javascript