INTERNET ART: networks, performative programming, and web as context

Basketball

Leave a comment

Here is my picture (can’t get one of all the balls because they hate me)screen-shot-2016-09-22-at-3-59-49-pm

And here is my code

float x=700;
float y=700;
float cw=150;
float r=random(1,100);
int eA=0;
int eB=5;
int eC=5;
int eD=0;
int ey=460;
int ey2=470;
int ey3=480;
int ey4=490;
int eSpeed=10;
int eSize=50;
color red=color(255,0,0);
color black=color(0,0,0);
color white=color(255,255,255);
color orange=color(255,145,0);
color bbfloor=color(181,132,68);
color bboard=color(218,243,242);
void setup(){
size(700,650);
noStroke();
}
void draw(){
background(white);

//floor
fill(bbfloor);
rect(0,550,700,100);

//bb board
fill(bboard);
rect(520,100,150,150);
line(600,250,600,560);
fill(red);
rect(560,170,60,50);
fill(bboard);
rect(570,180,40,30);
noFill();
ellipse(580,240,100,eSize);

//bball
fill(orange);
ellipse(mouseX,mouseY,50,50);

//flying balls
stroke(black);
fill(orange);
//top ball
ellipse(eA,ey,eSize,eSize);
//middle ball
ellipse(eB,ey2,eSize,eSize);
//middle ball
ellipse(eC,ey3,eSize,eSize);
//eC=eA+eSpeed;
//bottom ball
ellipse(eD,ey4,eSize,eSize);
//eD=eD+eSpeed;

if(mousePressed==true){
eA=eA+eSpeed;
eB=eB+eSpeed;
eC=eC+eSpeed;
eD=eD+eSpeed;
ey=ey-eSpeed;
ey2=ey2+2-eSpeed;
ey3=ey3+4-eSpeed;
ey4=ey4+8-eSpeed;
} else{
eA=eA;
eB=eB;
eC=eC;
eD=eD;
}

if(keyPressed==true){
eA=eA-eSpeed;
eB=eB-eSpeed;
eC=eC-eSpeed;
eD=eD-eSpeed;
ey=ey+eSpeed;
ey2=ey2-2+eSpeed;
ey3=ey3-4+eSpeed;
ey4=ey4-8+eSpeed;
} else{
eA=eA;
eB=eB;
eC=eC;
eD=eD;
}

//stick person
fill(white);
stroke(black);
ellipse(50,400,70,70);
line(50,435,50,540);
line(50,540,40,600);
line(50,540,60,600);
line(50,450,100,430);
line(50,450,100,440);
}

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s