So here is the object 'playerTurnObj'
function playerTurnObj(set_turn) { this.playerTurn=set_turn; function setTurn(turnToSet) { this.playerTurn=turnToSet; } function getTurn() { return this.playerTurn; } }
and that's what i do with it
var turn = new playerTurnObj(); turn.setTurn(1);
so I am trying to make the script method setTurn () in playerTurnObj () in order to keep the βrotationβ in the game that I am doing. The problem is that it does not turn.setTurn (1); because i keep getting the error above
what am I doing wrong? I searched, but could not find the exact answer to my question.
source share