Computer Science Canada Game Keeps Replaying |
Author: | darkage43 [ Wed Jun 15, 2011 6:25 pm ] | ||
Post subject: | Game Keeps Replaying | ||
What is it you are trying to achieve? Trying not to let the screen go back into playing the game. What is the problem you are having? Every time the screen shows you lose or you win the screen would then go back into playing the game. It only stops if I hit the quit button. Describe what you have tried to solve this problem I don't know what to do Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
Please specify what version of Turing you are using 4.1 |
Author: | Tony [ Wed Jun 15, 2011 6:37 pm ] |
Post subject: | Re: Game Keeps Replaying |
darkage43 @ Wed Jun 15, 2011 6:25 pm wrote: It only stops if I hit the quit button.
Is there any other way to exit that loop? |
Author: | ProgrammingFun [ Wed Jun 15, 2011 6:39 pm ] |
Post subject: | Re: Game Keeps Replaying |
You are not telling it to exit after displaying the message unless the button is pressed. |
Author: | darkage43 [ Wed Jun 15, 2011 6:46 pm ] | ||
Post subject: | RE:Game Keeps Replaying | ||
What I'm actually trying to do is when the game ends, the user still has the ability to click quit. I tried adding this to the program.
However this stops the game, which means it doesn't show the you win, you lose, or the quit button. |
Author: | darkage43 [ Wed Jun 15, 2011 7:50 pm ] |
Post subject: | Re: Game Keeps Replaying |
ProgrammingFun @ Wed Jun 15, 2011 wrote: You are not telling it to exit after displaying the message unless the button is pressed.
How would I do that then? |
Author: | ProgrammingFun [ Wed Jun 15, 2011 7:54 pm ] | ||
Post subject: | RE:Game Keeps Replaying | ||
If you want the person to only click "Quit" afterwards, you can add a long delay after exit when GUI.ProcessEvent in both cases here:
OR, you can declare a boolean variable at the beginning and run the game inside a while loop so that this variable is changed to exit the game when the user presses QUIT here ^. |
Author: | darkage43 [ Wed Jun 15, 2011 8:11 pm ] |
Post subject: | RE:Game Keeps Replaying |
When I add a long delay after GUI.ProcessEvent it also delays the time that it takes to appear the the button. |
Author: | Tony [ Wed Jun 15, 2011 8:15 pm ] |
Post subject: | Re: RE:Game Keeps Replaying |
darkage43 @ Wed Jun 15, 2011 8:11 pm wrote: When I add a long delay after GUI.ProcessEvent it also delays the time that it takes to appear the the button.
darkage43 @ Wed Jun 15, 2011 6:25 pm wrote: View.Update %Updates window offscreen |
Author: | darkage43 [ Wed Jun 15, 2011 8:25 pm ] |
Post subject: | RE:Game Keeps Replaying |
So there is some kind of problem where I'm placing the View.Update? |
Author: | Tony [ Wed Jun 15, 2011 8:58 pm ] |
Post subject: | RE:Game Keeps Replaying |
What happens when you place a delay before View.Update? |
Author: | ProgrammingFun [ Wed Jun 15, 2011 9:27 pm ] |
Post subject: | RE:Game Keeps Replaying |
Oh yes, my bad...as Tony said, place it after View.Update ![]() ![]() |
Author: | darkage43 [ Thu Jun 16, 2011 12:14 pm ] |
Post subject: | RE:Game Keeps Replaying |
Oh, alright I got it now. Thanks for the help. |