function Preload() {
	this.asset = null;
  this.ready = false;
}

Preload.prototype = {
  preload: function() {
    var style = { font: "65px LightUpTheWorld", fill: "#222", align: "center" };
    this.instructionText = this.add.text(-20, -20, ".", style);
    this.instructionText.alpha = 0;

    this.load.image('bg', 'assets/img/bg.png');
  },
  create: function() {

    //background for game
    this.add.sprite(0,0, "bg");

    this.asset = this.add.sprite(this.game.width/2,this.game.height/2, 'preloader');
    this.asset.anchor.setTo(0.5, 0.5);

    this.load.onLoadComplete.addOnce(this.onLoadComplete, this);
    this.load.setPreloadSprite(this.asset);

    //do all your loading here
    this.load.image('btnAbout', 'assets/img/btnAbout.png');
    this.load.image('btnStart', 'assets/img/btnStart.png');
    this.load.image('btnInstructions', 'assets/img/btnInstructions.png');

    this.load.image('btnBack', 'assets/img/btnBack.png');
    this.load.image('cursor', 'assets/cursor.png');
    this.load.image('title', 'assets/img/title.png');
    this.load.image('ripped', 'assets/img/ripped.png');
    this.load.image('ripped_tall', 'assets/img/ripped_tall.png');

    this.load.image('mute', 'assets/img/mute.png');
    this.load.image('mute_active', 'assets/img/mute_active.png');

    //assets for the drawing game
    var num_drawings = 7;
    for(var i=1; i <= num_drawings; i++) {
    	this.load.image('drawing'+i+"_color", 'assets/drawings/drawing' + i + '_color.png');
    	this.load.image('drawing'+i+"_line", 'assets/drawings/drawing' + i + '_line.png');
    }
    this.load.image('drawingBG', 'assets/drawings/drawing_background.png');

    //assets for hub
    this.load.image('btnBlank', 'assets/img/btnBlank.png');
    this.load.image('fingerTarget', 'assets/fingerTarget.png');

    //some music
    this.load.audio('titleMusic', ['assets/sounds/mp3/LPUGH_Title_Screen.mp3', 'assets/sounds/ogg/LPUGH_Title_Screen.ogg']);
    this.load.audio('dodgeMusic', ['assets/sounds/mp3/LPUGH_Spyhunter.mp3', 'assets/sounds/ogg/LPUGH_Spyhunter.ogg']);
    this.load.audio('drawingMusic', ['assets/sounds/mp3/LPUGH_Drawings.mp3', 'assets/sounds/ogg/LPUGH_Drawings.ogg']);
    this.load.audio('somethingMusic', ['assets/sounds/mp3/LPUGH_Somekindofsomething.mp3', 'assets/sounds/ogg/LPUGH_Somekindofsomething.ogg']);

    //well sounds now
    this.load.audio('loseSound', ['assets/sounds/mp3/LPUGH_Losesound.mp3', 'assets/sounds/ogg/LPUGH_Losesound.ogg']);
    this.load.audio('winSound', ['assets/sounds/mp3/LPUGH_Winsound.mp3', 'assets/sounds/ogg/LPUGH_Winsound.ogg']);
    this.load.audio('badSound', ['assets/sounds/mp3/LPUGH_Badsound.mp3', 'assets/sounds/ogg/LPUGH_Badsound.ogg']);

    //staaaart load
    this.load.start();
  },
  update: function() {

    if(this.ready) {
      this.game.state.start('menu');
    }

  },
  onLoadComplete: function() {
    this.ready = true;
  }
};

module.exports = Preload;