Skip to content

Instantly share code, notes, and snippets.

@ariaz
Created August 12, 2012 01:39
Show Gist options
  • Save ariaz/3328712 to your computer and use it in GitHub Desktop.
Save ariaz/3328712 to your computer and use it in GitHub Desktop.
just another inlet to tributary
{"editor_editor":{"coffee":false,"vim":false,"emacs":false,"width":600,"height":300,"hide":false}}
var speed = 5;
var y = 10;
var x = 250;
function circle(ctx){
ctx.fillStyle = '#000000';
ctx.beginPath();
ctx.arc(x+30,y+30,15,0,Math.PI*2, true);
ctx.closePath();
ctx.fill();
}
tributary.init = function(ctx) {
};
tributary.run = function(ctx,t) {
ctx.fillStyle = "#911B1B";
ctx.fillRect(0,0,tributary.sw, tributary.sh);
ctx.strokeStyle = "#C0B2B2";
ctx.strokeRect (1,1,tributary.sw-2,tributary.sh-2);
y += Math.cos(5*t);
if (y==100){y = 0;}
circle(ctx);
// tributary.clear(); //helper function to clear the canvas
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment