Graphics 640,480,32Global CurrentTexture=1,NextTexture=0,TempValue=0Const MAXWIDTH = 175Const MAXHEIGHT = 125'Change these to get different resultsGlobal DEPTH=-800Global VISCOSITY=128 'low the number the more water like, hight the number is more like oilGlobal WaveMap[4+1,MAXWIDTH+1,MAXHEIGHT+1]While Not KeyDown(KEY_ESCAPE) Cls UpdateWaveMap() If MouseDown(1) Then WaveMap(CurrentTexture,MouseX(),MouseY())=DEPTH Flip FalseWendFunction UpdateWaveMap() For y = 1 To MAXHEIGHT-1 For x = 1 To MAXWIDTH-1 n=(WaveMap(CurrentTexture,x-1,y)+WaveMap(CurrentTexture,x+1,y)+WaveMap(CurrentTexture,x,y-1)+WaveMap(CurrentTexture,x,y+1))/2 - WaveMap(NextTexture,x,y) n=n-n/VISCOSITY WaveMap(NextTexture,x,y)=n blue = 100-WaveMap(CurrentTexture,x,y) & 255 SetColor 0,0,blue SetAlpha 0.9 Plot x,y Next Next TempValue=CurrentTexture CurrentTexture=NextTexture NextTexture=TempValueEnd Function