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

Managing the game scene

In this task, we create four scenes and display different scenes based on the game flow.

Prepare for lift off

The following figure is our planning of the four scenes and the flow, showing on how they should link together:

Prepare for lift off

The following figure shows three scenes of what we will create in this task:

Prepare for lift off

Engage thrusters

We code the management part of the scene via the following steps:

  1. The scenes are DOM elements, so we will have the following HTML elements defined inside the tag with the game ID:
    <div id="game-scene" class="scene out"> ...

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