How to make ripples shrink
Author |
Message |
rcmp1234
|
Posted: Sat Apr 05, 2008 5:44 pm Post subject: How to make ripples shrink |
|
|
I am supposed to write a program showing the ripples shrinking once it reaches the top of the window
I tried using decreasing radius but it only shows one hollow circle shrinking and thats not what I want...I want the circles to disappear one by one
How do i do that?
Heres my program
const centerx := maxx div 2
const centery := maxy div 2
for radius : 1 .. centery by 10
delay (30)
drawoval (centerx, centery, radius, radius, magenta)
end for
for decreasing radius : centery .. 1 by 10
delay (30)
cls
drawoval (centerx, centery, radius, radius, magenta)
end for
Any help would be greatly appreciated
thanks |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
andrew.
|
Posted: Sat Apr 05, 2008 6:26 pm Post subject: Re: How to make ripples shrink |
|
|
Here you go.
I don't know why, but the decreasing moves the position by 2. It's weird but here.
Turing: | const centerx := maxx div 2
const centery := maxy div 2
for radius : 1 .. centery by 10
delay (30)
drawoval (centerx, centery, radius, radius, magenta)
end for
for decreasing radius : centery .. 1 by 10
delay (30)
drawoval (centerx, centery, radius+ 2, radius+ 2, white)
end for
|
P.S. Next time use the syntax="Turing" tags. |
|
|
|
|
![](images/spacer.gif) |
rcmp1234
|
Posted: Sat Apr 05, 2008 6:30 pm Post subject: RE:How to make ripples shrink |
|
|
Thanks andrew!! |
|
|
|
|
![](images/spacer.gif) |
andrew.
|
Posted: Sat Apr 05, 2008 9:03 pm Post subject: Re: How to make ripples shrink |
|
|
No problem. ![Mr. Green Mr. Green](http://compsci.ca/v3/images/smiles/icon_mrgreen.gif) |
|
|
|
|
![](images/spacer.gif) |
Mackie
![](http://compsci.ca/v3/uploads/user_avatars/217548454cee912ae1202.png)
|
Posted: Sat Apr 05, 2008 10:13 pm Post subject: RE:How to make ripples shrink |
|
|
andrew. don't do his work for him. He'll never learn anything that way, plus it is against the rules of the forum. |
|
|
|
|
![](images/spacer.gif) |
|
|