(AGK version: 2)
Submitted: 2014-11-13 13:24:27
//==============================================================================
//==============================  SNOWFLAKE-DEMO  ==============================
//============================== by Sigtrygg, 2014  ============================
//==============================================================================

sw=1024 //screen width
sh=768 //screen height

// set window properties
SetWindowTitle( "Snowflake" )
SetWindowSize( sw, sh, 0 )

// set display properties
SetVirtualResolution( sw, sh )


// Have fun to make experiments with changing parameters!!!

r=300 // Radius
x=sw/2 // start x, center of image
y=sh/2 // start y, center of image

//create image with size 1024x768 suitable for rendering
CreateRenderImage (1,sw,sh,0,0) 

Do

//set following drawcommands to the renderimage 1
SetRenderToImage (1,0) 

//draw one line with random colours
drawLine( x,y,x,y-r,Random(0,255),random(0,255),random(0,255)) 
t=random (0,100) //distance of first feather from center
distance=random(1,50) //distance between feathers


For u= t To 300 Step distance
	i=random (5,80) //Lenght of feather
	red=random (0,255) //value for red colour
	green=random (0,255) 
	blue=random (0,255)
	
	//make lines in angles of 60 degree
	drawLine (x,y-u,x+1.333*i,y-u-i,red, green, blue) 
	drawLine (x,y-u,x-1.333*i,y-u-i,red, green, blue)
Next u

//set following drawcommands to screen
setrendertoscreen () 

//create sprite ID 1 with image 1 at zero degree
//our renderimage with the first line and random colours
createsprite(1,1) 

//clone sprite 1 to sprite 2 and so on until sprite 5
For t=1 To 5
	cloneSprite (t+1,1) 
	//draw lines with interval of 60 degrees 
	setspriteangle( t+1,t*60) 
Next t

sync() //refresh screen

sleep (1000) //wait one second

//set a clear screen to the image 1 to delete previous snowflake
SetRenderToImage (1,0) 
ClearScreen()


loop
Help make AGK better by submitting an example for this command!
(All examples are subject to approval)
Login to post an example of your own.