Hi everybody i'm just trying executing a method inside a class and it's not working.
I got an "Uncaught TypeError: undefined is not a function" error.
I'm calling others functions and it's working well so I don't understand. I've tried to change the name and nothing.
I think that there is a problem with Phaser that I'm using but I've no idea...
Bomb.prototype.collisionBlocs = function() {
if (!this.hasBounced) {
this.bounce();
this.hasBounced = true;
}
}
Bomb.prototype.bounce = function() {
if (this.direction == 'UP') {
this.direction = 'DOWN';
}
else if (this.direction == 'RIGHT') {
this.direction = 'LEFT';
}
else if (this.direction == 'DOWN') {
this.direction = 'UP';
}
else if (this.direction == 'LEFT') {
this.direction = 'RIGHT';
}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…