Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Turing Help with flashing program
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
mayaramamurthy




PostPosted: 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?


house2.t
 Description:

Download
 Filename:  house2.t
 Filesize:  11.19 KB
 Downloaded:  115 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Raknarg




PostPosted: 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.
TerranceN




PostPosted: 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

Turing:
View.Set ("offscreen only")


Which should be

Turing:
View.Set ("offscreenonly")


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.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: