PrincipalGame.Void = function (game) {
	this.game = game;
};

GUIDES = 1;

PrincipalGame.Void.prototype = {
preload: function () {
		this.stage.backgroundColor = '#000000';

		this.load.image('tower','assets/images/cerebro.png');
		//this.load.image('suelo','assets/images/osciloscopioFront.png');
        this.load.spritesheet('target','assets/images/target.png', 430, 299);

		this.load.audio('cumparsita','assets/audio/cumparsita.wav');

		this.load.image('splash','assets/images/splash.png');
         },

create: function () {
                if (GUIDES == 1)
                {
                        // +++ Guides +++
                        if (1 == 1)
                        {
                                this.add.text(this.game.width / 2, 10,
                                                "Into de Void", 
                                                {font: "20px monospace", fill: "#fff"}).anchor.setTo(0.5, 0.5);

                                var g = this.game.add.graphics(400, 200);
                                g.lineStyle(1, 0x00ff00, 1);
                                g.drawCircle(0, 0, 100);

                                g.moveTo(-100, -100);
                                g.lineTo(100, 100);
                                g.moveTo(-100, 100);
                                g.lineTo(100, -100);
                                g.moveTo(0, 100);
                                g.lineTo(0, -100);
                                g.moveTo(-100, 0);
                                g.lineTo(100, 0);
                        }
                        else if (1 == 1)
                        {
                                var g = this.game.add.graphics(0, 0);
                                g.lineStyle(1, 0xff0000, 1);

                                g.moveTo(267, 0);
                                g.lineTo(267, 400);
                                g.moveTo(534, 0);
                                g.lineTo(534, 400);
                        }
                        // --- Guides ---
                }

		this.game.physics.startSystem(Phaser.Physics.ARCADE);
    		this.game.physics.arcade.gravity.y = 250;

		this.t = new Target(this.game);
		this.t.Add();

		this.Music_sound = this.game.add.audio('cumparsita');
		this.Music_sound.loop = true;
		this.Music_sound.play();

		this.game.add.sprite(0, 0, 'splash');
        },

update: function () {
		this.t.update();

		if (this.game.input.keyboard.isDown(Phaser.Keyboard.K)) {
			this.t.kill();
		}
		if (this.game.input.keyboard.isDown(Phaser.Keyboard.J)) {
			this.t.revive();
		}
	},

    render: function  () {

        this.game.debug.body(this.t.sprite);

    }
};

