How do I eliminate flickering for "for loops"?
Author |
Message |
Vomirak
|
Posted: 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?
Description: |
it's based on the video game Portal |
|
 Download |
Filename: |
Turing Assignment.t |
Filesize: |
7.66 KB |
Downloaded: |
72 Time(s) |
|
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
Insectoid

|
Posted: 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
code: |
for x:0..200
draw blah blah blah
View.Update
delay (five)
erase stuff
end for
|
The general order of operations is draw stuff, view.update, delay, erase stuff.
|
|
|
|
|
 |
Aange10

|
Posted: Sat Nov 05, 2011 9:01 pm Post subject: RE:How do I eliminate flickering for "for loops"? |
|
|
Here's an example, aswell
|
|
|
|
|
 |
Beastinonyou

|
Posted: 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.
|
|
|
|
|
 |
Velocity

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