xxxxxxxxxx
/*------------------------
Heart Race
Created 2/17
Kali Johnston
SP 2017
knjohnston0704@gmail.com
---------------------------*/
void setup () {
size (700, 500);
background (225);
frameRate(45);
}
int x = 25;
int y = 25;
float a = 15;
float b = 15;
float c = 15;
void draw() {
background(225);
line(590, 15, 590, 465);
line(25, 140, 600, 140);
line(25, 270, 600, 270);
line(25, 410, 600, 410);
fill(255,0,0);
heart(a, 75);
a = a + random(0,10);
fill(0,255,0);
heart(b, 215);
b = b + random(0,10);
fill(#FF8E03);
heart(c, 335);
c = c + random(0,10);
if (a > 590){
noLoop();
fill(255,0,0);
textSize(20);
textAlign(RIGHT);
text("True Love WINS!", width/3,height/10);
}
if (b > 590){
noLoop();
textSize(20);
fill(0,255,0);
textAlign(RIGHT);
text("Wicked Love WINS!", width/3,height/3);
}
if (c > 590){
noLoop();
textSize(20);
fill(#FF8E03);
textAlign(RIGHT);
text("Burnin' Love WINS!", width/2,height/1.5);
}
}
void heart(float x, float y) {
triangle(x+80,y+10,x+10,y,x+60,y+71);
//right
ellipse(x+80, y, 60, 60);
//left
ellipse(x+40, y, 60, 60);
}