Code archives/Graphics/Snow

This code has been declared by its author to be Public Domain code.

Download source code

Snow by jankupila2009
Snow
Graphics 800,600

Type THiutale
Field x:Int
Field y:Int
End Type

Local hiutale_lukumaara:Int=12

Global lumilist:TList=CreateList()

While Not KeyDown(key_escape)
For Local m=1 To hiutale_lukumaara
Local Newhiutale:Thiutale
Newhiutale=New THiutale

newhiutale.x=Rand(10,790)
newhiutale.y=1
ListAddLast(lumilist,newhiutale)
Next

For Local hiutale:thiutale=EachIn lumilist
hiutale.x:+Rand(-1,1)
hiutale.y:+1
Plot (hiutale.x,hiutale.y)
If hiutale.y=500 Then lumilist.remove hiutale
DrawLine 1,500,800,500

Next
DrawText "Particles : "+lumilist.count(),20,20

Flip
Cls
Wend

Comments

dw8172016
This is an interesting program you wrote, Jankupila.

Being very new to TYPE variables, I am going to take a look at this code closely. Thanks for keeping it in such readable format !


Code Archives Forum