OOP javascript object inheritance (parent/child)
<p>Hello I'm working with Javascript OOP and I can't get it to work. I want to call functions from another object (parent) via the child. This is my "class" code:</p>

<pre><code>function Unit(_x, _y, _speed) {
    this.x = _x;
    this.y = _y;
    this.dx = _speed;
    this.dy = _speed;
    this.gravity = 0;
}
Unit.prototype.apply_gravity = function() {
    this.gravity+=global_gravity;
    this.y+=this.gravity;
}
Unit.prototype.render = function() {
    context.drawImage(images[0], canvas_screen.x+this.x, canvas_screen.y+this.y);
}

function Character() {
}

Character.inheritsFrom(Unit);
</code></pre>

<p>I want to be able to call the functions: "apply_gravity" and "render" from the character object like this:</p>

<pre><code>var character = new Character(100,100,5);
character.render();
</code></pre>
