
-----------------------------------
mayaramamurthy
Wed Feb 08, 2012 8:46 pm

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?

-----------------------------------
Raknarg
Wed Feb 08, 2012 9:38 pm

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.

-----------------------------------
TerranceN
Wed Feb 08, 2012 11:06 pm

Re: Turing Help with flashing program
-----------------------------------
Did you not understand View.Set ("offscreen only")

Which should be

View.Set ("offscreenonly")

Note that there isn't a space in the correct version.

As for the sun and moon, your code:
        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.
