Wave function for making water or effects
Popolon
|
You can divide by about 240 times the number of sin (heavy and slow computation), and / a bit slow too by moving the computation out of for x loop:
for y... local Y=math.sin((y+t)/freq)*off for x=... pix(x+Y,y,... |
Popolon
|
And using the map function https://github.com/nesbox/TIC-80/wiki/map
You could draw the whole line in one C compiled operation instead of using lua interpreted pixel by pixel drawing, this could be far faster :). |
crimester
|
Thanks for the advice!
I will make another revision with the compiled operation ;). |
crimester
|
i will also try making naother one using the map/cell thingy
|
crimester
|
^ ^ ^ brainfart ^ ^ ^ .
|
Popolon
|
Cool :) Hope you will achieve great code :). We are all brainfarts, until we have more experience and exchanges ;).
|