const DEBUG = true;

let app;

/** PIXI and PIXI.Assets init */
window.onload = function() {
  'use strict';

  app = new PIXI.Application({
    width: 640,
    height: 360,
    backgroundColor: 0x2a2a3a,
  });
  document.body.appendChild(app.view);

  // PIXI.Assets.add('texture_name', '/assets/texture.png');

  // let promise = PIXI.Assets.load(
  //   ['texture_name'],
  //   (progress) => {
  //     if (DEBUG)
  //       console.log(`Assets loading progress: ${progress * 100}%`);
  //   });

  // promise.then((value) => {
  //   backgroundTextures = value;
  //   initLevel();
  // });
}

/** Level init */
function initLevel() {
  'use strict';

  app.ticker.add(gameLoop);
}

/** Game loop */
function gameLoop(delta) {
  'use strict';

  //
}
