dwitter.net | kchplr (3658)

+ 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.
Try the new frontend: beta.dwitter.net
Current theme challenge: #ScaryMovies
show FPS hide FPS share fullscreen
remix of d/2938 by u/kchplr

function u(t) {

}//
117/140


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

  • Same as the original but with c.style='image-rendering:pixelated' to look better and the same size

Please log in (or register) to comment.

show FPS hide FPS share 1 remix fullscreen

function u(t) {

}//
140/140


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

  • Show more comments…
  • u/kchplr
    ninerdelta: I think that the reason is that c.width|=something is not only clearing the canvas but also the 2d context. Without it each iterations keeps adding arcs to the current path, by the 10th frames there are 2000 arcs to redraw, by the 50th frames there are 10000, etc. In a, err, "non-cold golfing codebase" you could avoid this by using beginPath and closePath.
  • u/kchplr
    "cold golfing", superb. I meant code golfing...
  • u/ninerdelta
    ah that makes sense, thanks!
  • u/donbright
    now this is fine work

Please log in (or register) to comment.

show FPS hide FPS share 1 remix fullscreen

function u(t) {

}//
139/140


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

  • change C(p) to C(i) for kicks
  • u/New_Core
    try this... for(x.fillRect(0,0,2e3,2e3),Z=V=W=960,j=950;--j;Z=j%98-t*6+(V=t*6|0))x.clearRect(W+S(p=t+j/4-6.03*V)/Z*W-Z*9,540+C(p)/Z*W,s=99/Z,s)

Please log in (or register) to comment.

show FPS hide FPS share fullscreen

function u(t) {

}//
139/140


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

  • mostly what i was going for... not exactly.

Please log in (or register) to comment.

show FPS hide FPS share fullscreen
Xen
remix of d/3017 by u/kchplr

function u(t) {

}//
123/140


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

  • An lsd inkblot inspired by Kchplr inspired by Cantelope

Please log in (or register) to comment.

show FPS hide FPS share 1 remix fullscreen

function u(t) {

}//
135/140


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

  • u/kchplr
    Noticed it is very slow in firefox, has lot of artefact on Safari and doesn't even render properly in stable Chrome. The only browser rendering it correctly is Chrome Canary. Oh, well.
  • u/kchplr
    Here is a version which renders correctly on stable Chrome : for(x.fillStyle='rgba(0,0,0,.1)',x.fillRect(0,i=0,2e3,2e3);i<7;Y=S(i*2+t),X=(C(2*i)+C(t+i+Y)),x.clearRect(960+X*450,536+Y*500,20,9))i+=.002

Please log in (or register) to comment.

show FPS hide FPS share fullscreen

function u(t) {

}//
139/140


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

  • just made a few small changes.. loved this one and wanted to see it with colors inverted :D

Please log in (or register) to comment.

show FPS hide FPS share fullscreen

function u(t) {

}//
135/140


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

Please log in (or register) to comment.

show FPS hide FPS share fullscreen
remix of d/3005 by u/FireFly

function u(t) {

}//
137/140


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

  • Ripples! With proper quads instead. Add +Z*X-Z*16 after X*60 for perspective projection too (brings it up to 146)
  • u/FireFly
    Another byte can be saved with with(x), but this causes a fair bit of slowdown for me. Thanks for some golfing tips from qfox and others on the jsgolf slack :)
  • u/cantelope
    can't stop watching. def in my top 10 favs
  • u/iverjo
    Very impressive!

Please log in (or register) to comment.

show FPS hide FPS share 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).

  • I dunno...
  • u/Xen
    'only a basic dweet', nope you put in effort, you receive an awesome.....

Please log in (or register) to comment.

Loading...
Next page