Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cls()
- MAGIC_NUM_1 = 16
- MAGIC_NUM_2 = 30
- gc = 0
- plasma = {}
- function dist(x1, y1, x2, y2)
- return sqrt(((x2-x1)*(x2-x1)) + ((y2-y1)*(y2-y1)))
- end
- function rerange(n, omin, omax, nmin, nmax)
- return (((n - omin) * (nmax - nmin)) / (omax - omin)) + nmin
- end
- function plasma()
- local c
- local c1
- local c2
- local c21
- for y=1,127 do
- for x=1,127 do
- c1 = sin(x / MAGIC_NUM_1 + gc)
- c2 = sin(dist(x, y, sin(-gc) * MAGIC_NUM_2 + MAGIC_NUM_2, cos(-gc) * MAGIC_NUM_2 + MAGIC_NUM_2) / MAGIC_NUM_1)
- c = c1 + c2 + gc
- pset(x, y, rerange(c, -1, 1, 1, 15))
- end
- end
- end
- function _init()
- end
- function _update()
- gc += 1
- end
- function _draw()
- cls()
- plasma()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement