-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBoss.java
More file actions
120 lines (94 loc) · 2.22 KB
/
Copy pathBoss.java
File metadata and controls
120 lines (94 loc) · 2.22 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
import java.awt.Color;
import java.awt.Graphics;
public class Boss extends PolygonModel {
int velX = 1;
Bullet bleft;
Bullet bmid;
Bullet bright;
int sideSpeed = 4;
int midSpeed = 6;
boolean upgrade1 = false;
boolean upgrade2 = false;
boolean upgrade3 = false;
static int[][] xStruct =
{
};
static int [][] yStruct =
{
};
int rectX = 180;
int rectY = 180;
Rect r;
int health = 50;
boolean alive = true;
int crashDMG = 60;
public Boss(int x, int y) {
super(x, y, xStruct, yStruct);
r = new Rect(x - (rectX/2), y -(rectY/2) - 5, rectX, rectY);
bleft = new Bullet(0,0,15,15,Color.yellow);
bmid = new Bullet(0,0, 25,25,Color.cyan);
bright = new Bullet(0,0,15,15,Color.yellow);
}
public int getSideSpeed(){
return sideSpeed;
}
public void increaseSide(int var){
sideSpeed += var;
}
public int getMidSpeed(){
return midSpeed;
}
public void increaseMid(int var){
midSpeed += var;
}
public int getVelX(){
return velX;
}
public void setVelX(int var){
velX = var;
}
public int getCrashDMG(){
return crashDMG;
}
public int getHealth(){
return health;
}
public void hit(){
health--;
if(health <= 0)
alive = false;
}
public void moveDownBy(int var){
y += var;
}
public void moveSidewaysBy(int var){
x += var;
}
public void draw(Graphics g){
//Draws bounding box for object
r.setX(x - (rectX/2));
r.setY(y -(rectY/2) - 5);
//r.draw(g);
//Draws the object on the window
//top
g.setColor(new Color(150,255,150));
g.fillOval(x - 70, y - 50, 40, 80);
g.fillOval(x - 30, y - 100, 60, 120);
g.fillOval(x + 30, y - 50, 40, 80);
g.setColor(Color.black);
g.drawOval(x - 70, y - 50, 40, 80);
g.drawOval(x - 30, y - 100, 60, 120);
g.drawOval(x + 30, y - 50, 40, 80);
//bottom
g.setColor(Color.DARK_GRAY);
g.fillOval(x - 90, y - 10, 180, 90);
//orbs
g.setColor(Color.yellow);
g.fillOval(x + 60, y + 20, 20, 20);
g.fillOval(x + 30, y + 20, 20, 20);
g.fillOval(x - 50, y + 20, 20, 20);
g.fillOval(x - 80, y + 20, 20, 20);
g.setColor(Color.cyan);
g.fillOval(x - 20 , y + 10, 40, 40);
}
}