The error I'm receiving is:
Uncaught TypeError: Object #<Player> has no method 'move' test.js:6
init test.js:6
(anonymous function)
I'd really appreciate it if somebody could let me know where I'm going wrong.
Thanks,
Joel.
var player;
init();
function init() {
player = new Player();
player.move();
}
function Player() {
this.width = 10;
this.height = 10;
}
Player.prototype.move = function() {
alert("Hello, I've moved");
};

New Topic/Question
Reply



MultiQuote



|