Skip to content

Instantly share code, notes, and snippets.

@justinobney
Last active August 29, 2015 14:13
Show Gist options
  • Select an option

  • Save justinobney/8f69edf480287aa0ad52 to your computer and use it in GitHub Desktop.

Select an option

Save justinobney/8f69edf480287aa0ad52 to your computer and use it in GitHub Desktop.
var Game = {
init: init,
draw: draw
}
function init(name){
this.name = name;
}
function draw() {
console.log('draw');
}
var Ball = Object.create(Game)
Ball.update = update;
Ball.init = init;
function update() {
console.log('ballz');
this.draw()
}
function init(size){
Game.init.call(this, 'ball')
console.log('size', size);
console.log('name', this.name);
}
var ball = Object.create(Ball)
ball.init('big');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment