'recurring ellipsii.sdlbas [B+=MGA] 2016-07-13
'extending Administrator's code example at SdlBasic forum
sw = 800 : sh = 600
setdisplay(sw, sh, 32, 1)
setcaption("Recurring Ellipsii")
autoback(-2)
sub drawEllipsii(x, y, w, h, oset)
ellipse(x, y, w, h)
if(h > 15) then
ink(0x800000)
drawEllipsii(x + w/2*oset, y, w/2*oset, h/2*oset, oset)
ink(0x0000ff)
drawEllipsii(x - w/2*oset, y, w/2*oset, h/2*oset, oset)
ink(0x008000)
drawEllipsii(x, y + h/2*oset, w/2*oset, h/2*oset, oset)
ink(0xffff00)
drawEllipsii(x, y - h/2*oset, w/2*oset, h/2*oset, oset)
end if
end sub
oset = 0 : dr = 1
while 1
cls
ink(0xffffff)
drawEllipsii(sw/2, sh/2, sw/2, sh/2, oset)
screenswap
wait(60)
oset += .01 * dr
if oset >= 1.01 then
dr = dr * -1
elseif oset <= 0 then
dr = dr * -1
end if
wend