var goDevourer = function (game, options, api) {
    var self = {};
    self.name = "devourer";
	var devourer = null;
	var startPos = null;
	var devourerMovementX = null;
	var devourerMovementY = null;
	var start = false;

    self.getObject = function () {
        return enemy;
    }

    self.moveObject = function (relX, worldX) {
        enemy.x += relX;
        /*if (startPos.x < worldX + 500) {
            start = true;
        }
        */
    }

    self.preload = function () {
        game.load.image(self.name, 'resources/images/piikkikasa.png');
		game.load.image("devourerBG", 'resources/images/piikkikasa.png');
    }

	self.setInitialPosition = function (point) {
        startPos = point;
	}

    self.create = function () {
        devourer = game.add.sprite(startPos.x, startPos.y, self.name);
        enemy.anchor.setTo(0, 0);
		devourerMovementX = 50;
		devourerMovementY = -20;
		devourer.body.drag.setTo(0, 0);
		devourer.body.velocity.x=+devourerMovementX;
		devourer.body.velocity.y=+devourerMovementY;
    }

    self.update = function () {
        if (start === false)
            return;

    }

    return self;
}