dwitter.net

+ New dweet
function u(t) {
} //
122/140


Please log in (or register) to post a dweet (copy-paste the code somewhere safe to save it meanwhile)


u(t) is called 60 times per second. t: Elapsed time in seconds. S: Shorthand for Math.sin. C: Shorthand for Math.cos. T: Shorthand for Math.tan. R: Function that generates rgba-strings, usage ex.: R(255, 255, 255, 0.5) c: A 1920x1080 canvas. x: A 2D context for that canvas.
show FPS hide FPS share 1 remix fullscreen

function u(t) {

}//
136/140


Please log in (or register) to post as a new dweet (copy-paste code somewhere safe to save it meanwhile).

  • u/quuxman
    I was hoping to shrink it to the point of adding little dots, but I don't think it's possible
  • u/quuxman
    I was hoping to shrink it to the point of adding little dots, but I don't think it's possible
  • u/quuxman
    c.width+=0 x.fillRect(0,0,w=2e3,w) x.fillStyle='#ff0' x.moveTo(a=t*500%w,b=540) x.arc(a,b,100,m=S(t*15)*.4+.4,-m) x.fill()
  • u/mohd-akram
    Yeah, that was my initial goal :D
  • u/mohd-akram
    c.width+=0;x.fillRect(0,0,w=2e3,w);y=540;t=t*y%w;for(i=w;i>=0;i-=5e2)if(!i||t<i)x.beginPath(),x.lineWidth=l=i?20:99,x.arc(i||t,y,l/2,m=i?.01:S(t/l*2)**2,-m),x.strokeStyle=R(y,y,i&&y),x.stroke()
  • u/joeytwiddle
    You could post the "too long" version on codegolf.tk if you like :)

Please log in (or register) to comment.

u(t) is called 60 times per second. t: elapsed time in seconds. c: A 1920x1080 canvas. x: A 2D context for that canvas. S: Math.sin C: Math.cos T: Math.tan R: Generates rgba-strings, ex.: R(255, 255, 255, 0.5)