
-----------------------------------
Vomirak
Sat Nov 05, 2011 12:18 pm

How do I eliminate flickering for &quot;for loops&quot;?
-----------------------------------
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?

-----------------------------------
Insectoid
Sat Nov 05, 2011 1:05 pm

RE:How do I eliminate flickering for &quot;for loops&quot;?
-----------------------------------
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
[/code]

The general order of operations is draw stuff, view.update, delay, erase stuff.

-----------------------------------
Aange10
Sat Nov 05, 2011 9:01 pm

RE:How do I eliminate flickering for &quot;for loops&quot;?
-----------------------------------
Here's an example, aswell


View.Set ("offscreenonly")
for i : 1 .. 5
    cls
    drawfillbox (10, 0, 40, 40, (11 + i))
    View.Update
    delay (1000)
end for



-----------------------------------
Beastinonyou
Sun Nov 06, 2011 7:05 am

Re: RE:How do I eliminate flickering for &quot;for loops&quot;?
-----------------------------------


View.Set ("offscreenonly")


I bet this is the line of code he's missing from his program. Without this, View.Update does nothing.

-----------------------------------
Velocity
Tue Nov 08, 2011 8:34 pm

RE:How do I eliminate flickering for &quot;for loops&quot;?
-----------------------------------
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
