O'Reilly logo

Build an HTML5 Game by Karl Bunyan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 7. Levels, Sound, and More

In this chapter, we’ll add a few finishing touches to Bubble Shooter and cover a few more features of HTML5. Right now, the bubble grid could fill up the entire page in no time, giving players no room to fire bubbles. To prevent this from happening, we’ll make the game end if the player adds more than two rows to the bottom of the board. We’ll also implement multiple levels and high scores using the Local Storage API, smooth out animation with requestAnimationFrame, and add sound to the game with HTML5. Let’s start by adding multiple levels and high scores.

Multiple Levels and High Scores

It’s possible to complete a level by clearing out all of the bubbles, but thereafter, if you want to play again, you must refresh ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required