Jump to content

title screen troubles


Nek0
 Share

Recommended Posts

this seems a rudimentary task, but i'm actually having trouble implementing a title screen into a game. i've saved this task for last thinking it simple, but i can't seem to find a way to do it cleanly. i believe the creation of "states" is involved, but i can't figure these out, and the one example on the phaser website is hopelessly confusing.

everything in this project thus far is located in a single "game.js" file. i tried making a separate "title.js" and going from there, but perhaps this is the wrong approach. i simply want something that occurs before the game.js, shows a static image, and when anything is pressed (either keyboard or mouse) it launches "game.js". any example of this would be great.

Link to comment
Share on other sites

  • 2 weeks later...

seriously? no one on this whole wide site knows how states in phaser 2 work?

i solved the prob without using states, but i still wouldn't mind hearing a salient explanation on how to use them.

Link to comment
Share on other sites

thanks again @Horizonicblue, i've run into this tutorial before and it's still a bit convoluted for my tastes. i'll stare at it again though and see what i can extrapolate out of it. in the meantime i've coded things in a manner that avoids states entirely (except for the main game state).

Link to comment
Share on other sites

Welcome, here is another example on states https://phaser.io/examples/v2/p2-physics/state-reset , in this example just see the structure of state and try to replicate with only one sprite and minimum amount of code that might help you understand it better. If you explore more there are lot of other ways of doing this as well. 

This is es6 way of doing https://www.joshmorony.com/phaser-fundamentals-using-states-in-phaser/

Edited by Horizonicblue
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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