Jump to content

Basic splash screen


ZRT
 Share

Recommended Posts

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

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

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

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

@ZRT

This 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!

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...