
-----------------------------------
rcmp1234
Sat Apr 05, 2008 5:44 pm

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

-----------------------------------
andrew.
Sat Apr 05, 2008 6:26 pm

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.

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.

-----------------------------------
rcmp1234
Sat Apr 05, 2008 6:30 pm

RE:How to make ripples shrink
-----------------------------------
Thanks andrew!!

-----------------------------------
andrew.
Sat Apr 05, 2008 9:03 pm

Re: How to make ripples shrink
-----------------------------------
No problem.  :mrgreen:

-----------------------------------
Mackie
Sat Apr 05, 2008 10:13 pm

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.
