Log In  

Cart #22711 | 2016-06-11 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

Accidentally found a fun wavy transition effect while screwing around with math.

I added nice comments to the source. Try pulling it down and tweaking the values to see if you can make it even cuter-looking.


function _update()
 --increase timer

function _draw()

 --this crazy bit loops through
 --limited background colors,
 --and changes it when the
 --screen is covered with white
 local c = 12 + ((t-2.55)/4)%4

 for i=0,8 do -- column loop
  for j=0,8 do -- row loop
    --x positions are snapped
    --to 16px columns
    local x = i*16

    --this number sweeps back
    --and forth from -1 to 1
    local osc1 = sin(t+i*0.1)

    --this number also sweeps
    --back and forth, but at
    --a different rate
    local osc2 = sin(t/4+j*0.03)

    --y positions are influenced
    --by one of the sweepy
    local y = j*16 + osc1*10

    --the circles' radii are
    --influenced by the other
    --sweepy number
   circfill(x, y, osc2*15, 7)
P#22710 2016-06-11 18:58 ( Edited 2016-06-13 16:51)

:: impbox

really enjoying your posts emu! :3
so many cute things!

P#22837 2016-06-13 12:51 ( Edited 2016-06-13 16:51)

I know this post is old, but WOW

P#90861 2021-04-20 22:04

[Please log in to post a comment]

Follow Lexaloffle:        
Generated 2021-05-06 19:44:00 | 0.010s | Q:15