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