Jump to content

title screen troubles


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...

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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