oval animation
Author |
Message |
xgoldbergx
|
Posted: Sat Apr 01, 2006 1:17 pm Post subject: 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 |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Cervantes
|
Posted: Sat Apr 01, 2006 1:32 pm Post subject: (No subject) |
|
|
Please use 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
|
Posted: Sat Apr 01, 2006 1:34 pm Post subject: (No subject) |
|
|
try this
code: |
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
|
Posted: Sat Apr 01, 2006 1:43 pm Post subject: (No subject) |
|
|
thanks alot |
|
|
|
|
|
Clayton
|
Posted: Sat Apr 01, 2006 8:35 pm Post subject: (No subject) |
|
|
note:
setscreen = View.Set |
|
|
|
|
|
do_pete
|
Posted: Sat Apr 01, 2006 8:41 pm Post subject: (No subject) |
|
|
note:
1. That post was completely useless
2. We've already solved this problem
3. Stop your spamming |
|
|
|
|
|
|
|