O'Reilly logo

HTML5 Game Development HOTSHOT by Makzan

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 3. Space Runner

In the previous project, we created two game examples that take mouse inputs. In this project, we are going to create another game example with game loop and keyboard inputs. The player controls an avatar that runs from the moon station towards space. The goal is to run as far as possible without hitting any obstacles.

We will learn how to create sprite sheet-based animations with a CSS background and use JavaScript to handle keyboard inputs.

Mission briefing

We will learn how to create a CSS-based sprite sheet animation. We will also learn the concept of parallax scrolling and use JavaScript to handle keyboard inputs. You can visit the URL http://makzan.net/html5-games/space-runner/ to play the example game in order to have ...

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