Computer Science Canada How would i go about making a pause button or pause key? |
Author: | vdemons [ Mon May 23, 2011 5:13 pm ] | ||||
Post subject: | How would i go about making a pause button or pause key? | ||||
I have been thinking about this for a while, and have done two attempts, both only paused when the button (when made as a button) was held and both didn't work at all (just as a procedure) so I would like to ask how do make a pause button here were my methods. #1
and #2
|
Author: | Raknarg [ Mon May 23, 2011 5:35 pm ] |
Post subject: | RE:How would i go about making a pause button or pause key? |
You could still do it the way you have it set up, just you would need to use 2 keys instead of 1. When you press p, it pauses. However, it also unpauses whenever p is pressed. The problem is that the change is so fast, that the user doesn't have time to let go of the p key before the loop begins. |
Author: | Tony [ Mon May 23, 2011 5:46 pm ] | ||
Post subject: | RE:How would i go about making a pause button or pause key? | ||
That's not even the issue (although it often is).
If "key = ('p')" is true the first time, it's guaranteed to also be true the second time. |
Author: | vdemons [ Mon May 23, 2011 5:50 pm ] |
Post subject: | RE:How would i go about making a pause button or pause key? |
oh I see whats happening now, is there a way to delay the change somehow |
Author: | vdemons [ Mon May 23, 2011 5:56 pm ] |
Post subject: | RE:How would i go about making a pause button or pause key? |
I tried changing the second p into something else like q but it would pause, and stay paused . . . forever. if key = ('p') then loop if key = ('q') then |
Author: | Tony [ Mon May 23, 2011 6:15 pm ] |
Post subject: | RE:How would i go about making a pause button or pause key? |
Think about all the conditions that need to hold true for the code to get to the "unpause"/exit part. Can this ever happen? |
Author: | RandomLetters [ Mon May 23, 2011 10:00 pm ] |
Post subject: | RE:How would i go about making a pause button or pause key? |
procedure pausing if chars ('p') then loop if chars ('p') then exit end if end loop end if end pausing How do you know what the person is pressing? |