Turing Help with flashing program
Author |
Message |
mayaramamurthy
|
Posted: Wed Feb 08, 2012 8:46 pm Post subject: Turing Help with flashing program |
|
|
How would I get my turing program to stop flashing? I have used View.Set ("offscreenonly") as well as View.Update and View.UpdateArea, but still it keeps flashing, what can I do?
Description: |
|
![](http://compsci.ca/v3/pafiledb/images/icons/clip.gif) Download |
Filename: |
house2.t |
Filesize: |
11.19 KB |
Downloaded: |
115 Time(s) |
|
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Raknarg
![](http://compsci.ca/v3/uploads/user_avatars/3745510004d8be6689b92f.jpg)
|
Posted: Wed Feb 08, 2012 9:38 pm Post subject: RE:Turing Help with flashing program |
|
|
You're using View.UpdateArea more than once. You should only use it more than once in the same loop if there's a good reason for it. In this case, there is not.
|
|
|
|
|
![](images/spacer.gif) |
TerranceN
|
Posted: Wed Feb 08, 2012 11:06 pm Post subject: Re: Turing Help with flashing program |
|
|
Did you not understand my post from the other thread you made?
I opened your code, and on the second line you still have
Which should be
Note that there isn't a space in the correct version.
As for the sun and moon, your code:
Turing: | Draw.FillOval (80, y, 65, 65, 43)
delay (100)
Draw.FillOval (80, y, 65, 65, 17)
y := y - 10
View.UpdateArea (0, 0, maxx, maxy) |
Is of the form:
-Draw sun to the off-screen buffer
-Delay 100 milliseconds
-Draw a black oval over the sun on the off-screen buffer, effectively removing it
-Move the sun coordinate down 10 pixels
-Draw the off-screen buffer to the screen
If you rearranged those, it would make more sense.
This pattern is found throughout your code, and a simple re-ordering fixes pretty much all of your flickering problems (at least anything I saw). Just remember: nothing gets drawn to the screen until View.Update() or View.UpdateArea() are called.
|
|
|
|
|
![](images/spacer.gif) |
|
|