Created
September 16, 2015 16:29
-
-
Save kdoodoo/fc94f3928735e9b8e885 to your computer and use it in GitHub Desktop.
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
//ellipe | |
var a; | |
var b = 0; | |
var c; | |
var d; | |
var e; | |
//rect | |
var o; | |
var p = 800; | |
var q; | |
var r; | |
var s; | |
function setup() { | |
createCanvas(800,600); | |
a = random(0,800); | |
} | |
function draw() { | |
background(a,255-b,b); | |
b = b + 1; | |
c = 30; | |
d = 30; | |
ellipse(a,b,c,d); | |
o = mouseX-15; | |
p = p - 20; | |
q = 30; | |
r = 30; | |
rect(o,p,q,r); | |
rect(o,p-40,q,r); | |
if(b > 800){b = 0;} | |
if(p < 0){p = 800;} | |
if (a-25 < o && o < a+10 && b-20 < p && p < b+20){ | |
rect (0,0,800,600); | |
b = 0; | |
a = random(0,800); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment