Aleksander87 Posted July 16, 2017 Share Posted July 16, 2017 function collectStar (player, star) { // Removes the star from the screen star.kill(); // Add and update the score score += 10; scoreText.text = 'Score: ' + score; if(score === 120) { WHAT TO DO HERE?? show text gameover and retry button (restart game) } } Hello. I'am newbie in Phaser. I just want to upgrade tutorial game with gameover and try again mode. I create if statement when player reach 120 points and next gameover text appear and retry/restart button. Please give me some advice. Link to comment Share on other sites More sharing options...
Kacper Pietrzak Posted July 16, 2017 Share Posted July 16, 2017 You can simply create a Phaser.Text object, set its visible property to false and set it to true on game end. There are of course some things to take care of, dependent on your project such as blocking player's input. You can do exactly the same with Phaser.Button that says Try Again. And just in onclick callback of the button reset whole scene. Link to comment Share on other sites More sharing options...
WiLD11 Posted July 16, 2017 Share Posted July 16, 2017 this may help you. Link to comment Share on other sites More sharing options...
Gammerr Posted March 19, 2018 Share Posted March 19, 2018 Where is the try again button? Link to comment Share on other sites More sharing options...
Recommended Posts