-
Notifications
You must be signed in to change notification settings - Fork 0
/
Baby.pde
43 lines (37 loc) · 783 Bytes
/
Baby.pde
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
void Baby() {
pushStyle();
image(baby, xBaby, yBaby, 60, 60);
xBaby=xBaby+xBabySpeed;
yBaby=yBaby+yBabySpeed;
if (xBaby>width-30||xBaby<130) {
xBabySpeed=xBabySpeed*-1;
}
if (yBaby>height-40||yBaby<80) {
yBabySpeed=yBabySpeed*-1;
}
popStyle();
}
void BabyMeter() {
pushStyle();
stroke(242, 199, 208);
strokeWeight(12);
line(10, 24, width-10, 24);
popStyle();
pushStyle();
stroke(246, 238, 34);
strokeWeight(7);
line(10, 24, BabyMeterBar, 24);
popStyle();
if (xHouseWife>=xBaby-50 && xHouseWife<=xBaby+50 && yHouseWife>=yBaby-50 && yHouseWife<=yBaby+50) {
BabyMeterBar+=15;
}
else {
BabyMeterBar+=0;
}
if (BabyMeterBar<10) {
BabyMeterBar=10;
}
if (BabyMeterBar>width-10) {
BabyMeterBar=width-10;
}
}