Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 oval animation
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
xgoldbergx




PostPosted: 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
Sponsor
sponsor
Cervantes




PostPosted: Sat Apr 01, 2006 1:32 pm   Post subject: (No subject)

Please use
code:
[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




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




PostPosted: Sat Apr 01, 2006 1:43 pm   Post subject: (No subject)

thanks alot Very Happy
Clayton




PostPosted: Sat Apr 01, 2006 8:35 pm   Post subject: (No subject)

note:

setscreen = View.Set
do_pete




PostPosted: 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
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: