Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added keyboard controls and game.paused function to the updated files #11

Closed
wants to merge 8 commits into from
Closed

Conversation

Deepaksharm
Copy link
Contributor

No description provided.

@Vigneshsekar
Copy link
Member

This pull request was affecting the change made in the previous one (Fixed the Bug in "Click here to finish the game" button ).

@AkshayAgarwal007
Copy link

@Vigneshsekar , were you referring to this pull request regarding the game.paused functionality? There is no any relevance of blindly replacing the pause state variable with game.paused. This won't work. For e.g take the case of replay function in catchflow.js. The point where the pauseState=1 has been replaced by game.paused==true the game is paused, according to the phaser docs all the subsystems gets paused and the only way one can come out of this is by creating a callback to an unpause function by binding it to the input.onDown event of the game object. Now if one wants the user to resume the game by clicking on the pause button again then the mouse pointer's position when the unpause function is called has to be detected and checked that whether it is inside the boundaries of the pause button or not.

So what you were doing was storing an integer value in a pause state variable and were blocking calls to certain functions depending on the value but using game.paused in the same way can't work, when he is declaring game.paused==true inside the pauseAndPlay, the game is paused, the subsystems are paused, the pause object won't listen to any user clicks. Also in the replay function when he is declaring game.paused==true the game is paused and everything is locked there and one can't come out of it

I would like @Deepaksharm to explain me this code and correct me if I'm wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants