X
GO
en-USen-GBfr-FRes-ESit-ITnn-NOsv-SE
Animated Julia
Code
' 
' Animated Julia in AMOS 2
' The simplicity of AMOS, the speed of Javascript!
' :)
'

' Set the palette
Mult = 256 / 24
For C = 0 To 24
	Colour C, C * Mult * 65536 + C * Mult * 256 + C * Mult
Next C
Paper 0
Clw

' Information
Info$ = "                          Animated Julia in AMOS 2!                        "
Info$ = Info$ + ">>> AMOS 2 <<<                        The simplicity of AMOS, the speed of Javascript!"
Info$ = Info$ + "                              Please support me on Patreon : www.patreon/francoislionet :)                       Press any key to end..."

' Main loop
creal# = -0.8
cimag# = 0.156;
frame = 0
Radian
Do

	' Main loop
	for y = 0 To 199
		for x = 0 To 199
			cx# = -2 + x / 50
			cy# = -2 + y / 50
			i = 0
			Repeat
				xt# = cx# * cx# -cy# *cy# + creal#
				cy# = 2 * cx# * cy# + cimag#
				cx# = xt#
				Inc i
			Until ( cx# * cx# + cy# * cy# >= 4 ) | i >= 25
			Plot x, y, i
		Next x
	Next y

	' Next frame
	Inc frame
	creal# = -0.8 + 0.6 * sin( frame / ( 3.14 * 20 ) )
	cimag# = 0.156 + 0.4 * cos( frame / ( 3.14 * 40 ) )

	' Exit when a key is pressed
	if Inkey$ != "" Then Exit

	' Display the scrolling information
	If Info + 24 < Len( Info$ )
		A$ = Mid$( Info$, Info + 1, 24 )
	Else
		A$ = Mid$( Info$, Info + 1, Len( Info$ ) - Info ) + Left$( Info$, 24 - ( Len( Info$ ) - Info ) )
	End If 
	Locate 0, 25
	Pen 24
	Centre A$
	Inc Info
	If Info > Len( Info$ ) Then Info = 0
	
Loop