pheaset Posted October 16, 2016 Share Posted October 16, 2016 Hey Guys. Im currently working on a Breakout game using Phaser so that i get used to the framework. I was wondering if anyone knows how to add tempory text to a canvas or webgl for a win/lose screen. Thanks in advance Pheaset Quote Link to comment Share on other sites More sharing options...
mattstyles Posted October 17, 2016 Share Posted October 17, 2016 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. pheaset 1 Quote Link to comment Share on other sites More sharing options...
pheaset Posted October 22, 2016 Author Share Posted October 22, 2016 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 Quote Link to comment Share on other sites More sharing options...
mattstyles Posted October 31, 2016 Share Posted October 31, 2016 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. pheaset 1 Quote Link to comment Share on other sites More sharing options...
pheaset Posted October 31, 2016 Author Share Posted October 31, 2016 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.