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


Leave a comment

Mean Bean

float x = 100;
float y = 50;
float w = 150;
float h = 80;
float by=0;

void setup()
{
size(600,400);
}

float ballX = 0;
float ballY = 0;
float speedX = 10;
float speedY = 0;
int hit = 0;
int miss = 0;
void draw()
{
ellipse(250,200,200,100);

if(mousePressed) { hit = 0; miss = 0; }
float paddle = 1000/(hit+10);
if(ballX < 0 || ballX > width) speedX = -speedX;
if(ballY > height) {
speedY = -speedY;
float distance = abs(mouseX – ballX);
if(distance < paddle) hit += 1;
else miss += 1;
} else speedY += 1;

ballX += speedX;
ballY += speedY;

background(100, 100, 40);
fill(60);
text(“DO NOT CLICK THE CAN OF BEANS”,300,300);
text(“DO NOT CLICK THE CAN OF BEANS”,100,350);
text(“DO NOT CLICK THE CAN OF BEANS”,400,40);
fill(200);
text(“YOU WOULDN’T DARE USE YOUR ARROW KEYS –YOU’RE COWARD”,150,250);
text(“YOU ARE TOO WEAK TO USE ARROW KEYS”,200,280);
text(“arrow keys are only for the strong and the cunning.”,300,400);

fill(200,100,50);
ellipse(ballX, ballY, 50, 50);
fill(50,100,200);
rect(mouseX-paddle, height-10, 2*paddle, 10);
fill(0);
text(“beans: ” + hit, 10, 20);
text(“no beans: ” + miss, 10, 40);
PImage beans = loadImage(“beans.png”);
image(beans, 50, 0);
PImage beans2 = loadImage(“beans2.png”);
image(beans2,mouseX, mouseY);
if(mousePressed){
if(mouseX>x && mouseX <x+w && mouseY <y+h)
println(“A can of BEANS”);
if(mouseX>250 && mouseY>150 && mouseX<350 && mouseY<200 && mousePressed==true){

}

fill(42,255,15);
rect(mouseX,mouseY,200,200);
text(“clicked BEANS”,200,200);
text(“clicked BEANS”,300,100);
text(“clicked BEANS”,50,400);
PImage poo = loadImage(“Surprise.jpg”);
image(poo,50, 25);
fill(400,50,50);
PImage GGM = loadImage(“GGMSmall.png”);
image(GGM,500, 10);
text(“Cheap Games”,500,20);

}
else if(mouseX>250 && mouseY>150 && mouseX<350 && mouseY<200){
fill(50);
rect(mouseX,mouseY,200,200);

}
else if(mouseX>100 && mouseY>50 && mouseX<250 && mouseY<100){
fill(50);
rect(mouseX,mouseY,200,200);
}
if (key == CODED){
if (keyCode == DOWN){
y = y + 10;
fill(50);
rect(350,300,250,300);
}
else if (keyCode == UP) {
y = y -10;
fill(50);
rect(200,200,200,300);
}
else if (keyCode == RIGHT){
x = x + 10;
fill(50);
rect(59,200,200,200);
}
else if (keyCode == LEFT){
x = x -10;
fill(50);
rect(350,50,200,200);
} } }