Log In  

Cart #retrowave_demo-0 | 2020-05-04 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
11

P#75806 2020-05-04 21:21 ( Edited 2020-05-04 21:22)

Nice but way too slow - use fillp to set gradient and draw the background with horizontal rectfills. Same for filled circles, much better to use clip per row with native circfill.
good luck

P#75828 2020-05-05 06:08

thnx i'll try it

P#75835 2020-05-05 10:42
1

Also a heads up that if the member of a table you're initializing is keyed by a string, you don't have to use the [] format. So this:

     add(buildings,{["x"]=128-i*4+flr(rnd(4))-2,
                    ["height"]=3+flr(rnd(29)),
                    ["width"]=12-flr(rnd(8)),
                    ["depth"]=flr(rnd(4))
                    })

Can be expressed more concisely as:

     add(buildings,{x=128-i*4+flr(rnd(4))-2,
                    height=3+flr(rnd(29)),
                    width=12-flr(rnd(8)),
                    depth=flr(rnd(4))
                    })

It's just one of those syntactic-sugar things Lua has, mainly intended to make it feel more like an object than a table.

P#75859 2020-05-05 16:59
2

Cart #kogoyejeta-0 | 2020-05-11 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2


thanx to everybody

P#76373 2020-05-11 12:32

ah now we are talking ;)

P#76374 2020-05-11 13:35

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-28 10:48:52 | 0.013s | Q:26