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

Responsive Game

Leave a comment

Still glitchy, if you press the mouse for an even amount of frames it won’t work.

float X = 500;
float Y = 500;
float eX = width/2;
float eY = height/2;

float eD = 10;

float rectW = 100;
float rectH = 500;

float speed= 20;

String n = “LOSER”;

boolean button = false;

void setup (){
size (500,500);
frameRate(15);
}

void draw(){
background(0);
fill(100);
rect(0,0,rectW,rectH);

fill(0,255,0);
ellipse (eX,eY,eD,eD);
eX=eX+speed;

if (eX > width){
speed=speed*-1;
}

if (eX<0){
background(255,0,0);
fill(255,255,255);
text (n, X/3, Y/2);
textSize(72);
}
if (mousePressed){
fill(255,255,255);
rect(0,0,rectW,rectH);
}

if (mouseX < rectW && mouseX > 0 && mouseY > 0 && mouseY < rectH && mousePressed && eX < rectW){
button = true;
}
else {
button = false;

}
if (button){
speed = speed*-1+1;
rectW = rectW -1;

}

}
screen-shot-2016-09-27-at-3-13-23-pm

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