Bruno58 0 Report post Posted December 20, 2016 Hi Im currently working in a phaser.js game and I wanted to add switchable characters. I have My Main.state I have My game over Screen in Over.state and in the game over screen I have a button to where I click and we go to the store Items thats where I want to put my switchable characters store.js I kinda have an idea on how to do it but I want to hear it from you all my character state are as follows: preload: function () { this.load.spritesheet('bird', 'assets/bird.png',52 ,28, 7); }, create: function () { /////Bird/////////////////////////////////////////////////// this.bird = this.game.add.sprite(100, 200, 'bird'); }, simple character I want to be able to switch by selecting another in my store page. Share this post Link to post Share on other sites
Xesenix 5 Report post Posted January 5, 2017 you can pass initialization values for state via state.init so you can have state for choosing character and when character is chosen you can run: // choosing character state game.state.start('playState', clearWorldBoolean, clearCacheBoolean, paramsYouWantToPass) // playState init: function(paramsYouWantToPass) { //do whatever you need to do with chosencharacter passed via paramsYouWantToPass } 1 kudefe reacted to this Share this post Link to post Share on other sites