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

Loading the bitmap graphics into the game

In this task, we show the bitmap graphics by loading them into the game.

Prepare for lift off

In this task, we add the colored bitmaps and load them onto the game. These bitmaps are colored and exported from Adobe Flash.

Prepare for lift off

So, make sure we have the PreloadJS file ready in the vendors folder and in the index.html file:

<script src="vendors/preloadjs-0.4.1.min.js"></script>

Engage thrusters

Let's follow the given steps to load the graphics into the game:

  1. In the game.js file, we define the load method:
    game.load = function() { // load bitmap assets before starting the game var loader = new createjs.LoadQueue(false); ...

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