Hi, I used the game states to add different states like preload, main menu, game and status screen etc
and in the global variable, I have a group called container, and in Preloader I create or add the group; and for some reason when I try to access the group created by thePreloader from other states/classes, the game value of the group is null, and I cannot use that group unless I recreate it in the that state/class.
Is there a way to create a global group that I can share with the rest o
Yep, there is a way to pass parameters to other states.
https://photonstorm.github.io/phaser-ce/Phaser.StateManager.html
When you call start() method you can pass params to the other state, which you will get in the other's init() method.
E.g.:
create: function () {
var tmp = this.rnd.between (-1, 1);
this.state.start('StateB', true, false, tmp);
}
App.StateB.prototype = {
init: function (number) {
console.log(number);
}
};
But I