
-----------------------------------
xgoldbergx
Sat Apr 01, 2006 1:17 pm

oval animation
-----------------------------------
I'm trying to make a program that moves the circle to the other side of the screen, but my program makes it smear.
Can someone help me get rid of the smear? thanks.



setscreen ("graphics")

var x, y, xradius, yradius : int


x := 15
y := 200
xradius := 15
yradius := 15

loop
    delay (10)
    x := x + 1
    drawoval (x, y, xradius, yradius, red)
end loop

-----------------------------------
Cervantes
Sat Apr 01, 2006 1:32 pm


-----------------------------------
Please use [code][/code] tags when posting code.

Here are three things for you to consider.

1. Draw a white oval where the oval was last, update its position, then draw it in red.

2. Draw a big white box across the whole screen with Draw.FillBox (0, 0, maxx, maxy, white)

3. Use cls to clear the entire screen to the background colour (default is white).

-----------------------------------
HellblazerX
Sat Apr 01, 2006 1:34 pm


-----------------------------------
try this


setscreen ("graphics")

var x, y, xradius, yradius : int


x := 15
y := 200
xradius := 15
yradius := 15

View.Set ("offscreenonly")
loop
    View.Update
    delay (10)
    cls
    x := x + 1
    drawoval (x, y, xradius, yradius, red)
end loop

the reason it smears is because you're not clearing the screen after every loop.  Thats what the cls command does.  Also, View.Set ("offscreenonly") and View.Update remove any animation flickers.

-----------------------------------
xgoldbergx
Sat Apr 01, 2006 1:43 pm


-----------------------------------
thanks alot  :D

-----------------------------------
Clayton
Sat Apr 01, 2006 8:35 pm


-----------------------------------
note:

setscreen = View.Set

-----------------------------------
do_pete
Sat Apr 01, 2006 8:41 pm


-----------------------------------
note:

1. That post was completely useless
2. We've already solved this problem
3. Stop your spamming
