dwitter.net | CalSch (14425)

+ 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: #Food
show FPS hide FPS share fullscreen

function u(t) {

}//
132/140


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

  • My first dweet! Tips for working in javascript would be appreciated since I've never used it before
  • u/jellyedwards
    Hey Piggo, to reduce a few chars you don't need var, you can do -- instead of -=1 and you can put some statements in the last term of the from expression, have a look at this that does the same in 116 bytes: Z=Math.abs(T(t/3));for(X=90;X--;)for(Y=90;Y--;x.fillRect(X*10*Z-50,Z*Y*10-50,9,9))x.fillStyle=hsl(${t*150},95%,45%
  • u/jellyedwards
    Hmm the back quotes for removed from the hsl but you get the idea!
  • u/Piggo
    Awesome, thanks for the tips!

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

  • Oleg Frolov | Dribbble (sped up due to golfing)

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

  • u/tomxor
    I'm so torn, should I click awesome?
  • u/katkip
    yes. #obfuscated
  • u/CalSch
    What is this, why is "eval" backwards? Why is the text after the opening comment highlighted like a string instead of a comment? So confusing...

Please log in (or register) to comment.

show FPS hide FPS share fullscreen

function u(t) {

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

}//
130/140


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

  • half a sphere

Please log in (or register) to comment.

show FPS hide FPS share fullscreen

function u(t) {

}//
100/140


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

  • Ensō
  • u/katkip
    you did it backwards but ok
  • u/DataMeta
    There is no right or wrong way to draw one
  • u/DataMeta
    It is an act of meditation and an expression of the mind and body's state in the moment

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

  • an attempt at something like a twister
  • Show more comments…
  • u/joeytwiddle
    That's a very juicy #twister!
  • u/cyhawk
    I teach 9-year-olds programming and used a tidied up version of this to show them how to figure out how something works. They loved it! Thanks! I've added a bit of gap between the strands to make it easier to understand, and I think it looks good. Like Math.max(180*S(a-1.2),0).
  • u/rnbw
    wow, i would have never thought that my recreational programming would be used for educational purposes. glad i was able to help those kids out on their journeys!
  • u/danny@hille.dk
    Just saw this, nice code man! Save 11 b like this: for(c.width=i=300;i--;)for(j=8;j--;x.fillStyle=#f+j*15)x.fillRect(i,99-S(a=t-i/80*C(t+i/99)+j*.9)*40,1,Math.max(40*S(a-1.1),0))

Please log in (or register) to comment.

show FPS hide FPS share fullscreen

function u(t) {

}//
119/140


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

  • heh there is some calculations left over from a test with Math.ceil.. (can be lot shorter anyway..)
  • u/magna
    #default
  • u/joeytwiddle
    Just a golf to 112: c.width=1920;for(j=2;j--;)for(i=0;i<9;i++)k=j*2-1,x.fillRect(400+i*100+S(t)*300+k*25*S(t),400+k*300*C(t),52,200)

Please log in (or register) to comment.

remix of d/16527 by u/katkip

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

  • u/Xen
    sexy pattern but laggs here

Please log in (or register) to comment.

show FPS hide FPS share fullscreen

function u(t) {

}//
125/140


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

  • infinity

Please log in (or register) to comment.

Loading...
Next page