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

Username:   Password: 
 RegisterRegister   
 growing shrinking circle
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Paul




PostPosted: Thu Dec 18, 2003 10:30 pm   Post subject: growing shrinking circle

Im supposed to make this growing and shrinking circle, but when it shrinks, white stripes appear, is there anyway of doing this better?
code:

var xr, yr : int := 0
loop
    xr := 0
    yr := 0
    for a : 1 .. 200
        drawfilloval (maxx div 2, maxy div 2, xr, yr, black)
        xr := xr + 1
        yr := yr + 1
        delay (15)
    end for
    for b : 1 .. 200
        drawfilloval (maxx div 2, maxy div 2, xr, yr, black)
        delay (15)
        drawfilloval (maxx div 2, maxy div 2, xr, yr, white)
        xr := xr - 1
        yr := yr - 1
    end for
end loop
[/code]
Sponsor
Sponsor
Sponsor
sponsor
arhamz




PostPosted: Thu Dec 18, 2003 10:56 pm   Post subject: here it is

Here this will do the trick ( added the View.Update technique )

code:

View.Set("offscreenonly")
var xr, yr : int := 0
loop
    xr := 0
    yr := 0
    for a : 1 .. 200
        drawfilloval (maxx div 2, maxy div 2, xr, yr, black)
        xr := xr + 1
        yr := yr + 1
        View.Update
        delay (15)
    end for
    for b : 1 .. 200
        drawfilloval (maxx div 2, maxy div 2, xr, yr, black)
        View.Update
        delay (15)
        drawfilloval (maxx div 2, maxy div 2, xr, yr, white)
        xr := xr - 1
        yr := yr - 1
    end for
end loop
Paul




PostPosted: Thu Dec 18, 2003 11:09 pm   Post subject: thanx

thanx alot
Andy




PostPosted: Fri Dec 19, 2003 10:18 am   Post subject: (No subject)

Just use recursion, DUH
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  [ 4 Posts ]
Jump to:   


Style:  
Search: