I had a little fun with this recently and figured the someone else would feel the same way.
global width = 800
global height = 800
global maxIter = 32
setVirtualResolution(width, height)
offX# = -6.75/3.0*width
offY# = -1.5*height
zoom# = 1.0
myFractal = createSprite(generateFractal(offX#, offY#, zoom#))
do
if getPointerPressed()
setPrintSize(width/60.0)
print("Please Wait")
sync()
deleteSprite(myFractal)
magnification# = 1.5
offX# = offX#+(getPointerX()-width/2.0)*3/zoom#+abs(2.0/zoom#-2.0/zoom#*magnification#)*width/2.0
offY# = offY#+(getPointerY()-height/2.0)*3/zoom#+abs(2.0/zoom#-2.0/zoom#*magnification#)*height/2.0
zoom# = zoom# * magnification#
myFractal = createSprite(generateFractal(offX#, offY#, zoom#))
endif
sync()
loop
function generateFractal(offX#, offY#, zoom#)
zoom# = 1/zoom#*3
dots as integer = height
dim dot[dots] as integer
dot[0] = createSprite(0)
setSpritePosition(dot[0], -1, -1)
setSpriteSize(dot[0], 1, 1)
for n = 1 to dots-1 : dot[n] = cloneSprite(dot[0]) : next n
dim fractal[width-1,height-1] as integer
for x = 0 to width-1
for y = 0 to height-1
fractal[x,y] = calcIter((x*zoom#+offX#)/width, (y*zoom#+offY#)/height)
setSpritePosition(dot[mod(y, dots)], x, y)
tone = fractal[x,y]*1.0/maxIter*255
if fractal[x,y] = maxIter then tone = 0
setSpriteColor(dot[mod(y, dots)], tone, 0, 0, 255)
if mod(y, dots) = 0 then render()
next x
if mod(y, dots) <> 0 then render()
next x
for n = 0 to dots-1 : deleteSprite(dot[n]) : next n
outImage = getImage(0, 0, width, height)
swap()
endfunction outImage
function calcIter(x#, y#)
xx# as float = 0.0 : yy# as float = 0.0
iter = 0
while xx#^2 + yy#^2 < 4.0 and iter < maxIter
temp# = xx#^2 - yy#^2 + x#
yy# = 2.0*xx#*yy# + y#
xx# = temp#
iter = iter + 1
endwhile
endfunction iter
Just a warning, the code is only mildly efficient. Feel free to take a shot at speeding it up!
When the fractal is done generating, click the screen to zoom in by the magnification# value. Just be sure your setup.agc file contains the same height and width as the code and have fun!