Log In  


Cart #25628 | 2016-07-20 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
4

Cart #25619 | 2016-07-20 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
4

Hellou,

I think this is a very useful for everyone, who want create procedural maps.

Press Z key few times for smooth 'caves'.

EDIT: example is now as class.

How to:

...
	cave = TCellular:New()
	cave:Generate(128,116,0.6,4,5,5)
...
function DrawMap()
	for xm=1,cave._w do
		for ym=1,cave._h do
			if (cave:Map(xm,ym)==0) pset(xm,ym,0)
			if (cave:Map(xm,ym)==1) pset(xm,ym,7)

		end
	end
end
...

AndyGFX.

4


Result after 4 smooth steps.

AndyGFX



[Please log in to post a comment]