Created
August 12, 2012 01:39
-
-
Save ariaz/3328712 to your computer and use it in GitHub Desktop.
just another inlet to tributary
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"editor_editor":{"coffee":false,"vim":false,"emacs":false,"width":600,"height":300,"hide":false}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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