In this project, we're going to put together a game called Cave Runner. Okay, it won't win any prizes based on the originality of the game (or the title), nor will it win "the best game of the year" prize. But it's amusing and has a lot of potential to expand in various ways, so it serves as a good base, especially for the quick and diverting category many games try to fit into.
To accomplish this, we're going to heavily rely upon the HTML5 Canvas, which is the only way we're going to achieve anything even approaching 60 frames per second (the target for most games). Even so, only recent and powerful devices are going to meet this target, so we will also need to use some mathematics in order to create a game that isn't reliant on hitting 60 fps. If the game's timing relied solely on hitting 60 fps, 30 fps would feel as if we're playing the game in slow motion. Instead, we have to act like we're running at 60 fps—even if we can't display that many frames...