Code archives/Algorithms/Land generator

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

Download source code

Land generator by Nebula2007
Rotation

Tformfilter true will add blur

change the rotation values for
different forms.
; Land generator - Crom design

; Random colored blocks
; Image Rotation

Graphics 640,480,16,2
SetBuffer BackBuffer()

Global mim = CreateImage(50,50)

SetBuffer ImageBuffer(mim)
For y=0 To 50 Step 5
	For x=0 To 50 Step 5
		Select Rand(0,2)
			Case 0
			Color 0,0,0
			Case 1
			Color 144,255,0
			Case 2
			Color 0,255,0
		End Select
		Rect x,y,5,5,True
	Next
Next
SetBuffer BackBuffer()

TFormFilter  False
MidHandle mim
For i=0 To 25 : RotateImage mim,Rand(-12,12) : Next

While KeyDown(1) = False
	Cls
	DrawBlock mim,110,110
	Flip
Wend
End

Comments

TAS2008
Slow, but neat!


Code Archives Forum