dwitter.net | OlegSchwann (3902)

+ 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 fullscreen

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

  • Circles

Please log in (or register) to comment.

show FPS hide FPS share fullscreen

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

  • Ghost of Kyiv

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

  • Explode
  • Show more comments…
  • u/danny@hille.dk
    also whenever the order of execution isn't important you can shorten for loops like this: for(i=100;i--;); becaus 0 is falsy, so when i reaches 0 the loop exits
  • u/danny@hille.dk
    you an free up space, so you can center the Explotion like this: c.width=640,x.translate(320,180);for(i=99;i--;)for(z=99;z--;x.rotate(.12))x.fillRect(z*t+S(t)*10,i*t+C(t),2*S(i),5*S(z))
  • u/danny@hille.dk
    this example adds some additional golfhing tricks: 99 is almost 100 :-), use the free slot in the for loop to execute code, you would otherwise execute inside the for loop
  • u/sanco
    Thanks a lot danny! I'm new on this so really appreciate the comments.

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

  • Waving surface. Remix of my first dweet (3D Sombrero Equation).

Please log in (or register) to comment.

show FPS hide FPS share fullscreen

function u(t) {

}//
122/140


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

  • Sleep

Please log in (or register) to comment.

show FPS hide FPS share fullscreen
remix of d/25019 by u/tomxor

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

  • #road at night + cars + street lights

Please log in (or register) to comment.

show FPS hide FPS share 1 remix fullscreen
remix of d/25008 by u/Joachim

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

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

  • Blue and Red objects

Please log in (or register) to comment.

show FPS hide FPS share 1 remix fullscreen

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

  • Treescape 🌲

Please log in (or register) to comment.

Loading...
Next page