dwitter.net | sanco (44)

+ 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
remix of d/25061 by u/sanco

function u(t) {

}//
133/140


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

  • More patterns

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

  • Patterns

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

Please log in (or register) to comment.

show FPS hide FPS share 1 remix fullscreen
remix of d/25044 by u/sanco

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

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

  • sincostan

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

  • First

Please log in (or register) to comment.

You've reached the end.