We should separate the pause logic from the replay logic and make the code more modular so that it would be easy for a new developer to pick up parts of code and develop a new level. The replay logic shouldn't have any relation with the pause logic.
This is different from the issue #1. This is not concerned with replacing the use of pauseState with game.paused but with separating the pause logic from replay logic and using better graphics to represent the same. function replayGame() { pause.destroy(); pause = game.add.sprite(575,455,'pause'); pause.inputEnabled = true; tempText = game.add.text(470, 470 , ' ' , {font : "15px Arial" , fill : "#eceff1"}); pauseState = 1; pauseAndPlay(); // The replay function shouldn't make use of this. score = 0; displayScore = 0; myscore.setText('000'); timer.setText('00:00:00')
pauseAndPlay(); // This replay function shouldn't make use of this.
We should separate the pause logic from the replay logic and make the code more modular so that it would be easy for a new developer to pick up parts of code and develop a new level. The replay logic shouldn't have any relation with the pause logic.
This is different from the issue #1. This is not concerned with replacing the use of pauseState with game.paused but with separating the pause logic from replay logic and using better graphics to represent the same.
function replayGame() { pause.destroy(); pause = game.add.sprite(575,455,'pause'); pause.inputEnabled = true; tempText = game.add.text(470, 470 , ' ' , {font : "15px Arial" , fill : "#eceff1"}); pauseState = 1; pauseAndPlay(); // The replay function shouldn't make use of this. score = 0; displayScore = 0; myscore.setText('000'); timer.setText('00:00:00')
pauseAndPlay(); // This replay function shouldn't make use of this.