The Advanced Game Developer's Toolkit: Create Amazing Web-based Games with JavaScript and HTML5 by Rex van der Spuy

The Advanced Game Developer's Toolkit: Create Amazing Web-based Games with JavaScript and HTML5 by Rex van der Spuy

Author:Rex van der Spuy [Rex van der Spuy]
Language: eng
Format: epub
Publisher: Apress
Published: 2017-07-03T21:00:00+00:00


//E. A `z` property to help track which depth level the sprites are on

let z = 0;

//Loop through all the map layers

tiledMap.layers.forEach(tiledLayer => {

//Make a group for this layer and copy

//all of the layer properties onto it

let layerGroup = new PIXI.Container();

Object.keys(tiledLayer).forEach(key => {

//Add all the layer's properties to the group, except the

//width and height (because the group will work those our for

//itself based on its content)

if (key !== "width" && key !== "height") {

layerGroup[key] = tiledLayer[key];

}

});



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.