Skip to content

Instantly share code, notes, and snippets.

@rezoner
Created April 8, 2015 15:28
Show Gist options
  • Save rezoner/aa895ca1d3212d732b2c to your computer and use it in GitHub Desktop.
Save rezoner/aa895ca1d3212d732b2c to your computer and use it in GitHub Desktop.
var app = new PLAYGROUND.Application({
preload: function() {
/* this is called before create and lets you silently load some assets */
this.loadData("objects/buildings", "objects/subObjects", "objects/townBuildingList");
},
create: function() {
/* this is called when preloader has finished */
var buildings = this.data["objects/buildings"];
for (var i = 0, len = buildings.length; i < len; i++) {
var building = building[i];
this.loadImages(building.imagePath + building.fileExtension);
}
},
ready: function() {
/* this is called when loader has finished */
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment