-
Notifications
You must be signed in to change notification settings - Fork 0
/
cactus.js
47 lines (42 loc) · 1.12 KB
/
cactus.js
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
43
44
45
46
47
class Cactus {
// constructor
constructor(num) {
this.siz = 80;
this.x = width;
this.y = height - this.siz;
this.imgInd = num;
}
// move
move() {
this.x -= 12;
}
// hitboxes
hitbox() {
}
show() {
// hitbox debugging
// strokeWeight(1);
// stroke(1);
// circle(this.x + this.siz/2, this.y + this.siz/2, this.siz);
switch(this.imgInd) {
case 1:
image(cacImg1, this.x, this.y, this.siz, this.siz);
break;
case 2:
image(cacImg2, this.x, this.y, this.siz, this.siz);
break;
case 3:
image(cacImg3, this.x, this.y, this.siz, this.siz);
break;
case 4:
image(cacImg4, this.x, this.y, this.siz, this.siz);
break;
case 5:
image(cacImg5, this.x, this.y, this.siz, this.siz);
break;
case 6:
image(cacImg6, this.x, this.y, this.siz, this.siz);
break;
}
}
}