ZRT Posted January 30, 2014 Share Posted January 30, 2014 Hi guys. I would like to add a splash screen to my little game and I've been looking around for the simplest option. It would basically be an image for now and the game needs to start once the splash image is gone. Is there any way to pull this off without using states/stages? I've been looking at the Tanks example and found this in the create(); function.logo = game.add.sprite(0, 200, 'logo');logo.fixedToCamera = true;game.input.onDown.add(removeLogo, this);function removeLogo () {game.input.onDown.remove(removeLogo, this);logo.kill();}So, instead of a logo like in the example, I would have an image that matches the canvas size. Any other suggestions, examples? Link to comment Share on other sites More sharing options...
Heppell08 Posted January 30, 2014 Share Posted January 30, 2014 That's pretty much the way to do it as you described. Add a button or something that activates all the killing of logos and the button itself to start the game. Although its a way to do it, I would recommend learning the states way. I wanted a splash screen and all the other stuff we associate with games but without states it was going to be a pretty hard task to pull off. Look in the resources folder in your phaser files and have a look at basic template if you even feel like giving states a shot. Link to comment Share on other sites More sharing options...
Biggerplay Posted January 30, 2014 Share Posted January 30, 2014 States is the way to go, you can set a state up for each state/scene of your game, so splash screen (template calls it MainMenu), game over, stage complete, map etc etc. Link to comment Share on other sites More sharing options...
ZRT Posted January 30, 2014 Author Share Posted January 30, 2014 Cool, thanks. I was going for a much basic solution but I think states will do. Can I pull that out in one single file? Any examples on that? Link to comment Share on other sites More sharing options...
Heppell08 Posted January 30, 2014 Share Posted January 30, 2014 Go into your phaser files and look in resources/basic That has the set up on states. i had some issues getting used to it so read the phaser debug info in console if needed. Link to comment Share on other sites More sharing options...
jerome Posted January 30, 2014 Share Posted January 30, 2014 good state tuto : http://s-nambiar.com/tutorials/managing-game-states-phaser/state doc : https://github.com/photonstorm/phaser/wiki/Phaser-General-Documentation-:-States Link to comment Share on other sites More sharing options...
ZRT Posted January 30, 2014 Author Share Posted January 30, 2014 Jerome, yep already checked those. Thank you guys. I thought of avoiding states, the game is very simple and didn't want to complicate, but I'll give 'em a shot. I want to learn how to use them, anyway. Link to comment Share on other sites More sharing options...
Biggerplay Posted January 30, 2014 Share Posted January 30, 2014 Jerome, yep already checked those. Thank you guys. I thought of avoiding states, the game is very simple and didn't want to complicate, but I'll give 'em a shot. I want to learn how to use them, anyway. I'm all for simple as well , it doesn't come more simple than using states to be honest. Link to comment Share on other sites More sharing options...
xnamex Posted January 30, 2014 Share Posted January 30, 2014 @ZRTThis is a shot in the dark, but maybe you're avoiding sates because of the lack of transition between them? Am I right?If that's the case, check this plugin I wrote: https://github.com/cristianbote/phaser-state-transition It's really helpful, and I'm thinking to improve it when I stumble over more 'demanding' transitions or something. Cheers! Biggerplay and jerome 2 Link to comment Share on other sites More sharing options...
jerome Posted January 30, 2014 Share Posted January 30, 2014 I'll link your plugin in the state documentationthanks :-) xnamex 1 Link to comment Share on other sites More sharing options...
xnamex Posted January 30, 2014 Share Posted January 30, 2014 I'll link your plugin in the state documentationthanks :-) Thank you! Link to comment Share on other sites More sharing options...
jerome Posted January 30, 2014 Share Posted January 30, 2014 cu plăcere Link to comment Share on other sites More sharing options...
Recommended Posts