Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Sep 20th, 2012  |  syntax: None  |  size: 0.77 KB  |  hits: 20  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. var speed = 5;
  2. var x = 250;
  3. var fbase = 28.2296;
  4. var omega0 = 2 * Math.PI * fbase;
  5. var om = omega0 * 0.04681;
  6. x0 = tributary.sw/2;
  7. y0 = tributary.sh/2;
  8.  
  9.  
  10.  
  11. function circle(ctx, y, r){
  12.   ctx.fillStyle = "rgba(" + 383 + ","+ "255, 255, 0.16051)";
  13.   ctx.rotate(0);
  14.   ctx.beginPath();
  15.   ctx.arc(x0,y0,r,6,Math.PI*2, true);
  16.   ctx.closePath();
  17.   ctx.fill();
  18. }
  19.  
  20. tributary.init = function(ctx) {
  21. };
  22. tributary.run = function(ctx,t) {
  23.  
  24.   ctx.fillStyle = "#911B1B";
  25.   ctx.fillRect(0,0,tributary.sw, tributary.sh);        
  26.   ctx.strokeStyle = "#572424";
  27.   ctx.strokeRect (1,1,tributary.sw-2,tributary.sh-2);
  28.   console.log(t);
  29.     var tt = Math.cos(t)/2;
  30.    
  31.     var p;    
  32.         p = [tt*100, tt];
  33.     circle(ctx,p,50);
  34.     circle(ctx,p,40);
  35. //    tributary.clear(); //helper function to clear the canvas
  36. };