-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathiBoundary.pde
More file actions
30 lines (29 loc) · 740 Bytes
/
iBoundary.pde
File metadata and controls
30 lines (29 loc) · 740 Bytes
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
class iBoundary extends iBase{
public iBoundary(){
}
public void show(){
bCX = baseCenterX - (int)fighter.myCenterX;
bCY = baseCenterY - (int)fighter.myCenterY;
rectMode(CENTER);
noFill();
stroke(255, 0, 0, 100);
strokeWeight(1000);
rect(bCX, bCY, 9100, 9100);
//LEFT BORDER
if(bCX - fighter.myCenterX > bCX + 4000){
fighter.myCenterX = bCX - 4300;
}
//RIGHT BORDER
if(bCX - fighter.myCenterX < bCX - 5000){
fighter.myCenterX = bCX + 4300;
}
//TOP BORDER
if(bCY - fighter.myCenterY > bCY + 4000){
fighter.myCenterY = bCY - 4300;
}
//BOTTOM BORDER
if(bCY - fighter.myCenterY < bCY - 5000){
fighter.myCenterY = bCY + 4300;
}
}
}