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

Hey Moon

Leave a comment

String n = “Hey Moon, Please Forget To Fall Down”;
String nn = “Hey Moon, Don’t You Go Down”;
boolean fall = false;
boolean collision = false;
boolean test = false;
float speed = 5;
float speed2 = 3;
float ydir = -2;
float xdir = random(-1,-5);
float x = 350;
float y = 50;
float dd = 50;
float j = 500;
float e = mouseX-15;
float f = mouseY-15;
float g = 30;
float grav = .001;

void setup () {
size (1000,500);
smooth();
background (0);
}

void draw () {
background(0);
noStroke();
fill(255,255,255,180);
stars();
fill(#F0F7C0);
stroke(255);
strokeWeight(3);
textSize(30);
text(n,(width/2)-250, 30);
fill(#B7FCFF);
text(nn, (width/2)-200, height – 30);
moon(j,y);
moonmove();
moonbounce();
square(e,f);
squaremove();
collision();
bounce();
texts();
textrest();

}
void stars(){

for (int yy= -10; yy<height+20; yy+=(random(50))){
for (int xx=-70; xx<width+30; xx+=(random(75))){
float aa = 140;
float bb = 255;
color ran = color((random(aa,bb)));
fill(ran);
ellipse(xx, yy, 3.5, 3.5);
ellipse(xx,yy,3,3);
float a = #EAEAD0;
float b = #A0F6FF;
color rand = color((random(a,b)));
fill(rand);
ellipse(2*xx, 2*yy, 3.5, 3.5);
ellipse(1.5*xx,1.5*yy,3,3);
}
}
}
void moon(float MoonX, float MoonY){
float dd = 50;
fill(180);
stroke(60);
ellipse(MoonX,MoonY,dd, dd);

}

void moonmove (){
y = y + (speed * ydir);
j = j + (speed2 * xdir);
speed2 = speed2 + grav;
}

void moonbounce (){
if (y < -300 ) {
ydir *= -1; }
if ( j < -10 || j > width) {
xdir *= -1;
ydir *= -1;}
if (y > height +30) {
y = -301;
j = random(40,650);}
}

void square (float squareX, float squareY) {
noFill();
noStroke();
rect(squareX, squareY, g,g);
}

void squaremove (){
e = mouseX-15;
f = mouseY-15;
}

void collision(){
float distance = dist(j,y,e,f);
if (distance < (dd+g)/2) {
collision = true;
println(“crash”);}
else{
collision = false;}
}

void bounce(){
float aa = -3;
float bb = 3;
if (collision == true){
ydir *= -1;
xdir *= 1;}
}

void texts() {
int de =(millis()/1000);
fill(155);
textSize (16);
textSize (18);
text(de, 50, 450);

}

void textrest() {
if (y > 500) {
texts();}
}

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