I am developing HTML5 MMO game using canvas, already 4 years. And I am still happy about my decision. Its fast enough, if i control the fps.
Just the UI to be responsive, needs much coding. But with CSS responsive app is also a difficult task.
I am using no HTML5 game framework, I don't know how they perform, or they wont create more problems than solutions,...
The HTML5 Canvas simply creates a rectangle in the screen, where you can draw custom graphics. It is usually preferred for games, because of the need to draw a lot of different elements, with complex animations.
Should I actually be using an HTML5 < canvas > element for this task?
In programming, usually there is no should. Can you make it work with ...
Use setInterval instead This will make the function get called multiple times.
The other option is to put a setTimeout call inside the lol function so it will be rescheduled.
To stop the scheduled call you can pass the return value of the setInterval or latest setTimeout to clearInterval or clearTimeout resp.
If you want something based on a per-frame basis you'd probably want to have some manual counters increased based on a deltaTime of some sort and reset at some threshold, but I think setInterval would be sufficient for your case. Don't forget to ...
You can navigate to another URL by setting the variable window.location.href = url or with the function window.location.replace(url).
The difference between the two methods is how the browser's back-button will behave. The first one will generate a separate navigation history entry for each level while the second one will not.
But, you should consider if ...