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

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




PostPosted: Mon Nov 29, 2004 4:36 pm   Post subject: animate cover

hello, how can i get this oval to move without covering up the background.


code:


drawfillbox (1, 1, 679, 300, red)
drawfillbox (1, 300, 679, 479, blue)

for c : 1 .. 400
    drawfilloval (1 + c, 300, 30, 30, green)
    delay (100)

    drawfilloval (1 + c, 300, 30, 30, red)%..........heres my problem

end for

[/code]
Sponsor
Sponsor
Sponsor
sponsor
Cervantes




PostPosted: Mon Nov 29, 2004 4:42 pm   Post subject: (No subject)

Just take your background and redraw it:
code:

for c : 1 .. 400
    drawfilloval (1 + c, 300, 30, 30, green)
    delay (100)

    drawfillbox (1, 1, 679, 300, red)
    drawfillbox (1, 300, 679, 479, blue)
end for

This works, but I think it's better structure if you keep all your drawing commands together, then put the delay after them, not having the drawing commands spread across the loop.

code:

for c : 1 .. 400
    drawfillbox (1, 1, 679, 300, red)
    drawfillbox (1, 300, 679, 479, blue)
    drawfilloval (1 + c, 300, 30, 30, green)
    delay (100)
end for

It's more understandable this way. You can tell easily that the background (the two drawbox lines) are behind the circle.
This is more important in larger programs. Wink
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  [ 2 Posts ]
Jump to:   


Style:  
Search: