Jump to content

winning screen and losing screen


pheaset
 Share

Recommended Posts

Maybe look into using Phaser states to handle navigating through your app. Your main state would be the breakout stuff, when you lose/win, navigate to the win state or the lose state and make sure there is some way (i.e. a button) for the user to navigate back to the game or a menu or intro state when they've finished viewing your super-awesome win/lose screen.

Link to comment
Share on other sites

On 10/17/2016 at 0:44 PM, mattstyles said:

Maybe look into using Phaser states to handle navigating through your app. Your main state would be the breakout stuff, when you lose/win, navigate to the win state or the lose state and make sure there is some way (i.e. a button) for the user to navigate back to the game or a menu or intro state when they've finished viewing your super-awesome win/lose screen.

Yep I guess that would be a good idea.

Any advice on how to do that? Kinda new to the whole phaser and javascript scene

Link to comment
Share on other sites

  • 2 weeks later...

I'm not a Phaser expert, I was hoping someone else would give pointers...

Try checking out the examples and searching the forum, should be enough info to get going.

I think the basics are that a state contains all the bits and pieces (variables, etc etc) that you need for that state, any shared variables and other stuff should be tacked on to the main Game object (or your own namespace object, or even just global, up to you), when you want to change state there is a function for that. States have lifecycle methods, the same ones you're used to, create, update etc, which can be leveraged to make things a little easier.

Link to comment
Share on other sites

13 hours ago, mattstyles said:

I'm not a Phaser expert, I was hoping someone else would give pointers...

Try checking out the examples and searching the forum, should be enough info to get going.

I think the basics are that a state contains all the bits and pieces (variables, etc etc) that you need for that state, any shared variables and other stuff should be tacked on to the main Game object (or your own namespace object, or even just global, up to you), when you want to change state there is a function for that. States have lifecycle methods, the same ones you're used to, create, update etc, which can be leveraged to make things a little easier.

Ok thank you @mattstyles

Ill try that out now so

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.

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

Loading...
 Share

  • Recently Browsing   0 members

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