Computer Science Canada

help with loop animation please

Author:  dmitrip [ Sat Feb 17, 2007 2:37 pm ]
Post subject:  help with loop animation please

hi, i need to make a program for school of an animation of my choice using a loop, so i decied to make a circle go from left to right and when the circle hits the "wall" it changes colour.

this is the code i have so far but it deos not seem to be working well

any help will be very appreciated thank you:)


[code]

for paint: 1..5

delay(500)

for a : 40 .. 600

drawfilloval (a , 40, 40,40, paint)

for decreasing b : 600..40

delay(10)
cls
drawfilloval (b , 40, 40,40, paint)



end for
end for
end for

[code]

Author:  LindenRulz [ Sun Feb 18, 2007 3:05 pm ]
Post subject:  Re: help with loop animation please

I have a solution that works really well!

for paint : 1 .. 5
for a : 40 .. 600
drawfilloval (a , 40, 40,40, paint)
delay (10)
cls
if a = 600 then
for decreasing b : 600..40
delay(10)
cls
drawfilloval (b , 40, 40,40, paint)
end for
end if
end for
end for


: