TypeError in a simple method call
<p>[RESOLVED]</p>

<p>defining the class</p>

<pre><code>var Stone = function(args){

    var _this = this;
    inherit(_this, args); //just copy all attributes from args to _this

    _this.w = 32;
    _this.h = 32;
    _this.obstacle = true;
    _this.padding = 0;
    _this.sprite = {
        x: 32,
        y: 0
    };

    _this.draw = function(){
        console.log(_this);
        CanvasPainter.sprite("background", _this.sprite.x, _this.sprite.y,
                             _this.x, _this.y, _this.w, _this.h);
    };
};
</code></pre>

<p>defining the object</p>

<pre><code>var stone = new Stone({
    x: 480,
    y: 320
});
</code></pre>

<p>invoking the method</p>

<pre><code>stone.draw(); //throws "TypeError: Type error"
</code></pre>

<p>I already know that I am doing something stupid.  Can you help me find it?</p>

<p>Here is the stone object:</p>

<pre><code>stone = {
  draw: function (),
  h: 32,
  obstacle: true,
  padding: 0,
  sprite: {x: 32, y: 0},
  w: 32,
  x: 480,
  y: 320
}
</code></pre>

<p>Actually the error comes from CanvasPainter.draw
was a stupid thing I`ve done</p>

<p>everything else is fine, thanks for help</p>
