var Ritual = Ritual || {};

Ritual.Wall = function (game_state, position, properties) {
    "use strict";
    Ritual.Prefab.call(this, game_state, position, properties);
    
    this.game_state.game.physics.arcade.enable(this);
    this.body.velocity.x = 0;//properties.direction * this.walking_speed;
    this.body.immovable = true;
	
    this.anchor.setTo(0.5);
};

Ritual.Wall.prototype = Object.create(Ritual.Prefab.prototype);
Ritual.Wall.prototype.constructor = Ritual.Wall;

Ritual.Wall.prototype.update = function () {
    "use strict";
    return;
	this.game_state.game.physics.arcade.collide(this, this.game_state.layers.collision);
    
    // change the direction if walked the maximum distance
    if (Math.abs(this.x - this.previous_x) >= this.walking_distance) {
        this.body.velocity.x *= -1;
        this.previous_x = this.x;
        this.scale.setTo(-this.scale.x, 1);
    }
};