function preload(assets, onloadcb, switchToLoadState = true) {
	// parse the resources
	for (let i = 0; i < assets.length; i++) {
		resourceCount += load(
			assets[i],
			onResourceLoaded.bind(this, assets[i]),
			onLoadingError.bind(this, assets[i]),
		);
	}
	// set the onload callback if defined
	if (typeof onloadcb !== "undefined") {
		onload = onloadcb;
	}

	if (switchToLoadState === true) {
		// swith to the loading screen
		state.change(state.LOADING);
	}

	// check load status
	checkLoadStatus(onload);
}
set all the specified game assets to be preloaded.
@memberof loader
@param {Asset[]} assets - list of assets to load
@param {Function} [onloadcb=loader.onload] - function to be called when all resources are loaded
@param {boolean} [switchToLoadState=true] - automatically switch to the loading screen
@example
game.assets = [
  // PNG tileset
  {name: "tileset-platformer", type: "image",  src: "data/map/tileset.png"},
  // PNG packed texture
  {name: "texture", type:"image", src: "data/gfx/texture.png"}
  // PNG base64 encoded image
  {name: "texture", type:"image", src: "data:image/png;base64,iVBORw0KAAAQAAAAEACA..."}
  // TSX file
  {name: "meta_tiles", type: "tsx", src: "data/map/meta_tiles.tsx"},
  // TMX level (XML & JSON)
  {name: "map1", type: "tmx", src: "data/map/map1.json"},
  {name: "map2", type: "tmx", src: "data/map/map2.tmx"},
  {name: "map3", type: "tmx", format: "json", data: {"height":15,"layers":[...],"tilewidth":32,"version":1,"width":20}},
  {name: "map4", type: "tmx", format: "xml", data: {xml representation of tmx}},
  // audio resources
  {name: "bgmusic", type: "audio",  src: "data/audio/"},
  {name: "cling",   type: "audio",  src: "data/audio/"},
  // base64 encoded audio resources
  {name: "band",   type: "audio",  src: "data:audio/wav;base64,..."},
  // binary file
  {name: "ymTrack", type: "binary", src: "data/audio/main.ym"},
  // JSON file (used for texturePacker)
  {name: "texture", type: "json", src: "data/gfx/texture.json"},
  // JavaScript file
  {name: "plugin", type: "js", src: "data/js/plugin.js"},
  // Font Face
  {name: "'kenpixel'", type: "fontface",  src: "url('data/font/kenvector_future.woff2')"},
  // video resources
  {name: "intro", type: "video",  src: "data/video/"},
  // base64 encoded video asset
  me.loader.load({name: "avatar", type:"video", src: "data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZ..."};
];
...
// set all resources to be loaded
me.loader.preload(game.assets, () => this.loaded());