Hello Hive! I've implemented a selection menu for my game in which I create a few buttons, one of which starts the actual game.
Game.SelectionMenu.prototype = {
init:function(levelData){
this.levelData = levelData;
},
create:function(){
var button = this.add.button(x, y, 'startButton', this.startGame, this);
},
startGame:function(){
this.state.start('Game', true, false, this.levelData);
}
} The problem arises when I navigate back to the selection menu:
...
navigateBack:function(){
this.state.start('SelectionMenu', true, false, this.levelData);
}
... The button appears (and even animates) but no longer fires when pressed. Is there some way to reset the state? Or is there something I'm missing about destroying a state once you leave it. I've tried:
this.state.restart but this doesn't seem to fix the issue. I'm working with Phaser 2.4.2. Altara Thanks in advance, guys!