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.

P#25620 2016-07-20 10:40 ( Edited 2016-07-20 17:38)

Result after 4 smooth steps.

AndyGFX

P#25625 2016-07-20 13:22 ( Edited 2016-07-20 17:22)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2023-02-02 07:17:33 | 0.005s | Q:12