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

Representing the quest composition

In this task, we declare the quest level and then display the level in the quest composition view.

Prepare for lift off

We will need three more JavaScript files in this task, so let's create them. These files are as follows:

  • patch.js: This file is used for adding methods to existing built-in objects to enhance convenience
  • composition.js: We use this file for logic that represents the composition
  • quest.js: These files represent the data of a quest, including the level and quest data manipulating methods

At the end of this task, we should be able to create a composition of patterns according to our level. For example, the following quest composition is composed of four patterns: a circle, the left and right trapezoid, ...

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