1 decade ago by dmen
In an entity i defined a variable in the defines section like so:
.defines(function () {
LevelOne = ig.Game.extend({
readyToPitch: false,
Then in update I did like so:
if(this.readyToPitch){
//code in here runs... ?
}
Why does setting the variable to false in the defines section not work? I stuck it in init() like so:
this.readyToPitch = false;
and then it works as expected. I was under the assumption I could set variables in the top defines section... but is that not the case?
.defines(function () {
LevelOne = ig.Game.extend({
readyToPitch: false,
Then in update I did like so:
if(this.readyToPitch){
//code in here runs... ?
}
Why does setting the variable to false in the defines section not work? I stuck it in init() like so:
this.readyToPitch = false;
and then it works as expected. I was under the assumption I could set variables in the top defines section... but is that not the case?