Pause a loop
Author |
Message |
9lucky
|
Posted: Thu Jan 19, 2012 12:21 am Post subject: Pause a loop |
|
|
What is it you are trying to achieve?
Pause a loop while my mouse if in a certain location.
What is the problem you are having?
I want to pause a loop when my mouse is a in a certain location.
Describe what you have tried to solve this problem
For example purposes I will use this code:
Turing: |
var x, y, button : int
loop
cls
mousewhere (x, y, button )
if x > 10 and y > 10 and x < 200 and y < 200 then
drawbox (10, 10, 200, 200, black)
end if
end loop>
|
Obviously it will blink the box that it draws because it is looping and cls is at the top. If I wanted to stop the box from blinking I would have to pause the loop, currently I would do this
Turing: |
var x, y, button : int
loop
cls
mousewhere (x, y, button )
if x > 10 and y > 10 and x < 200 and y < 200 then
drawbox (10, 10, 200, 200, black)
loop
mousewhere (x,y,button )
if x > 10 and y > 10 and x < 200 and y < 200 then
else
exit
end if
end loop
end if
end loop>
|
This will work fine although when I have a lot of code it can be confusing to read through it all. I was wondering if there mgiht be some sort of command that will pause the loop for me or do something similar to this, if there isn't is there a better way to do it?
Please specify what version of Turing you are using
4.1.0.0 |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Insectoid
|
Posted: Thu Jan 19, 2012 1:12 am Post subject: RE:Pause a loop |
|
|
Nope. But you can put that into a function, so that it looks nicer (which essentially creates a 'pause' command). |
|
|
|
|
|
|
|