I am attempting to call a method of an object in a game, and I keep getting this error: "Uncaught TypeError: Object # has no method 'calculateDps'", Here's the relevant code:
function Item(pBase, price){
this.pBase = pBase;
this.price = price;
pMultiplier = 1;
number = 0;
calculateDps = function(){
return this.pBase * pMultiplier * number;
};
};
var cursor = new Item(.1,15);
var calcDps = function(){
return cursor.calculateDps();
};
calcDps();