Player.prototype.update = function() { if( keyboard.up() ) { this.y -= 1; } }; Player.prototype.draw = function() { context.drawImage(this.image, this.x * 16, this.y * 16); };