dwitter.net | JeremyLikness (2902)

+ 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: #Opposites
show FPS hide FPS share 2 remixes 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).

Please log in (or register) to comment.


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).

Please log in (or register) to comment.

show FPS hide FPS share 1 remix fullscreen

function u(t) {

}//
131/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
Xen
remix of d/3697 by u/Citiral

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).

Please log in (or register) to comment.

show FPS hide FPS share fullscreen
Xen

function u(t) {

}//
115/140


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

  • u/lionleaf
    Welcome to all the new people from /r/programmer, hackernews and twitter! :D
  • u/Xen
    fresh blood lol! welcome to the jungle, take a look around ;-)
  • u/sigveseb
    oh god the colors:P and welcome to all
  • u/j0bit
    o.O what the heck is going on in this syntax?
  • u/iverjo
    @j0bit: Search for "JS Template Literals" and "JS Ternary Operator" on the internet
  • u/j0bit
    Cool, appreciate it.

Please log in (or register) to comment.

show FPS hide FPS share fullscreen
Xen
remix of d/697 by u/p01

function u(t) {

}//
99/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) {

}//
140/140


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

  • I'm sure some of you can shorten this considerably.
  • u/alien
    good sir what does F=(v)=> are you doing some functional programming here?
  • u/joeytwiddle
    🏳️‍🌈
  • u/cantelope
    @alien the F=(v)=> is indeed a function, using the short ES6 arrow syntax. Its purpose is to return a hex value between 0 and 255, (with a preceding 0 when value is less than 16). the hex code is then combined with 2 other hex codes to form a complete, valid color code in the form of #000000. There is a shorter way to do this but it results in exponentially fewer colors. sorry for delayed response.
  • u/New_Core
    Using rgb colors instead of hex you dont need to struggel with converting. a=130;for(i=1e3;i--;x.fillStyle=R(a*S(v=i/70-t*4)+a,a*C(v)+a,-a*S(v)+a))x.fillRect(5*i,0,5,2e3) a here uses 130 of the 255 colors to match the same colors.
  • u/alien
    thank you for the response @catelope

Please log in (or register) to comment.

show FPS hide FPS share fullscreen
remix of d/438 by u/New_Core

function u(t) {

}//
138/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/2238 by u/aemkei

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).

  • the world …

Please log in (or register) to comment.

Loading...
Next page