AppTitle "Random Landscape by Eikon 02.03.05" Graphics 640, 300, 16, 2 SetBuffer BackBuffer() SeedRnd MilliSecs() Type Obj ; Type that holds X,Y position Field X%, Y% End Type Const Dist% = 16 ; Pixels between each point Dim Points.Obj((640 / Dist) + 1) Local tmp% = 1 ; Counter For i = 0 To 640 Step Dist ; Create points Points.Obj(tmp) = New Obj ; Create type Points(tmp)\X = i Points(tmp)\Y = 300 - Rand(20, 50) tmp = tmp + 1 Next While Not KeyDown(1) ; Render Points For i = 1 To tmp - 1 If i <> 1 Then Line Points(i - 1)\X, Points(i - 1)\Y, Points(i)\X, Points(i)\Y Next If KeyHit(57) Then ; Regen Delete Each Obj tmp% = 1 ; Counter For i = 0 To 640 Step Dist ; Create points Points.Obj(tmp) = New Obj ; Create type Points(tmp)\X = i Points(tmp)\Y = 300 - Rand(20, 50) tmp = tmp + 1 Next EndIf Delay 10 ; Give CPU time Flip: Cls Wend: End