-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHitbox.pde
More file actions
61 lines (55 loc) · 1.11 KB
/
Copy pathHitbox.pde
File metadata and controls
61 lines (55 loc) · 1.11 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
class Hitbox
{
int xPos;
int yPos;
int wid;
int hei;
int type;
int xRadius;
int yRadius;
Hitbox(int xPos_, int yPos_, int wid_, int hei_, int type_)
{
xPos = xPos_;
yPos = yPos_;
wid = wid_;
hei = hei_;
type = type_;
//need to implement rect rect collisions
if (type == 1)
{
xRadius = wid / 2;
yRadius = hei / 2;
xRadius = yRadius;
}
}
void test()
{
//println(mouseX,mouseY);
}
void display()
{
pushStyle();
strokeWeight(4);
noFill();
switch(type)
{
case 0:
{
rect(xPos,yPos,wid,hei);
}
break;
case 1:
{
ellipse(xPos,yPos,wid,hei);
}
break;
}
popStyle();
//rect(xPos,yPos,wid,hei);
}
void update(float xPos_,float yPos_)
{
xPos = int(xPos_);
yPos = int(yPos_);
}
}