Computer Science Canada How do I eliminate flickering for "for loops"? |
Author: | Vomirak [ Sat Nov 05, 2011 12:18 pm ] |
Post subject: | How do I eliminate flickering for "for loops"? |
So this assignment im working on is due monday, but I have a problem with getting View.Update to work properly. I've played around with View.Update and i can't get it to work how I want. I have an object that has 7 layers of shapes/code on it, and whenever i try to make him move in a random direction, the object just flickers, this is what I'm doing to make him move, for x : 0..200 draw blah blah blah %%%original shape%%% delay (5) draw blah blah blah %%%eraser that follows original shape%%% end for What am i doing wrong? |
Author: | Insectoid [ Sat Nov 05, 2011 1:05 pm ] | ||
Post subject: | RE:How do I eliminate flickering for "for loops"? | ||
This is what your code should look like
The general order of operations is draw stuff, view.update, delay, erase stuff. |
Author: | Aange10 [ Sat Nov 05, 2011 9:01 pm ] | ||
Post subject: | RE:How do I eliminate flickering for "for loops"? | ||
Here's an example, aswell
|
Author: | Beastinonyou [ Sun Nov 06, 2011 7:05 am ] | ||
Post subject: | Re: RE:How do I eliminate flickering for "for loops"? | ||
Aange10 @ Sat Nov 05, 2011 9:01 pm wrote:
I bet this is the line of code he's missing from his program. Without this, View.Update does nothing. |
Author: | Velocity [ Tue Nov 08, 2011 8:34 pm ] |
Post subject: | RE:How do I eliminate flickering for "for loops"? |
You can add View.Set ("offscreenonly") ^^^ at the beginning of your loop ------------------------------------------------ and ... ------------------------------------------------ View.UpdateArea (0, 0, maxx, maxy) ^^^ at the end of your loop |