dwitter.net

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

u(t) is called 60 times per second. t: elapsed time in seconds. c: A 1920x1080 canvas. x: A 2D context for that canvas. S: Math.sin C: Math.cos T: Math.tan R: Generates rgba-strings, ex.: R(255, 255, 255, 0.5)