-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSpawn.java
131 lines (105 loc) · 5.53 KB
/
Spawn.java
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
121
122
123
124
125
126
127
128
129
130
131
package Enemies;
import java.awt.Color;
import java.util.Random;
import Enemies.*;
import Game.main.Game;
import Game.main.HUD;
import Game.main.Handler;
import Game.main.ID;
public class Spawn {
private Handler handler;
private HUD hud;
private int scoreKeep = 0;
private Random r = new Random();
private int looper;
public Spawn(Handler handler, HUD hud){
this.handler = handler;
this.hud = hud;
}
public void tick(){
scoreKeep++;
if(scoreKeep == 500){
hud.setWave(2);
handler.addObject(new BasicEnemy(r.nextInt(Game.WIDTH - 20), r.nextInt(Game.HEIGHT - 46), ID.Enemy, Color.yellow, handler)); //BasicEnemy
}
if(scoreKeep == 1000){
hud.setWave(3);
handler.addObject(new BasicEnemy(r.nextInt(Game.WIDTH - 20), r.nextInt(Game.HEIGHT - 50), ID.Enemy, Color.magenta, handler)); //BasicEnemy
}
if(scoreKeep == 1500){
hud.setWave(4);
handler.addObject(new BasicEnemy(r.nextInt(Game.WIDTH - 20), r.nextInt(Game.HEIGHT - 55), ID.Enemy, Color.pink, handler)); //BasicEnemy
}
if(scoreKeep == 2000){
hud.setWave(5);
handler.addObject(new LeftRigthEnemy(r.nextInt(Game.WIDTH - 22), Game.HEIGHT - 44, ID.Enemy, Color.orange, handler)); //LeftRightEnemy (BOTTOM)
handler.addObject(new LeftRigthEnemy(r.nextInt(Game.WIDTH - 22), 0, ID.Enemy, Color.orange, handler)); //LeftRightEnemy (TOP)
}
if(scoreKeep == 2500){
hud.setWave(6);
handler.addObject(new UpDownEnemy(0, r.nextInt(Game.HEIGHT - 45), ID.Enemy, Color.orange, handler)); //UpDownEnemy (LEFT)
handler.addObject(new UpDownEnemy(Game.WIDTH - 22, r.nextInt(Game.HEIGHT - 45), ID.Enemy, Color.orange, handler)); //UpDownEnemy (Right)
}
if(scoreKeep == 3000){
hud.setWave(7);
handler.addObject(new VerticallyFastEnemy(r.nextInt(Game.WIDTH - 20), r.nextInt(Game.HEIGHT - 42), ID.Enemy, Color.cyan, handler)); //VerticallyFastEnemy
}
if(scoreKeep == 3500){
hud.setWave(8);
handler.addObject(new HorizontallyFastEnemy(r.nextInt(Game.WIDTH - 20), r.nextInt(Game.HEIGHT - 42), ID.Enemy, Color.green, handler)); //HorizontallyFastEnemy
}
if(scoreKeep == 4000){
hud.setWave(9);
handler.addObject(new SmartEnemy(r.nextInt(Game.WIDTH - 20), r.nextInt(Game.HEIGHT - 42), ID.Enemy, Color.lightGray, handler)); //SmartEnemy
}
if(scoreKeep == 4500){
hud.setWave(10);
handler.clearEnemies();
handler.addObject(new EnemyBoss1(Game.WIDTH / 2 + 38, -155, ID.Enemy, handler)); //EnemyBoss1
}
if(scoreKeep == 6000){
hud.setWave(11);
handler.clearEnemies();
handler.addObject(new BasicEnemy(r.nextInt(Game.WIDTH - 20), r.nextInt(Game.HEIGHT - 46), ID.Enemy, Color.red, handler));
}
if(scoreKeep == 7000){
hud.setWave(12);
handler.addObject(new BasicEnemy(r.nextInt(Game.WIDTH - 20), r.nextInt(Game.HEIGHT - 46), ID.Enemy, Color.yellow, handler)); //BasicEnemy
}
if(scoreKeep == 8000){
hud.setWave(13);
handler.addObject(new BasicEnemy(r.nextInt(Game.WIDTH - 20), r.nextInt(Game.HEIGHT - 50), ID.Enemy, Color.magenta, handler)); //BasicEnemy
}
if(scoreKeep == 9000){
hud.setWave(14);
handler.addObject(new BasicEnemy(r.nextInt(Game.WIDTH - 20), r.nextInt(Game.HEIGHT - 55), ID.Enemy, Color.pink, handler)); //BasicEnemy
}
if(scoreKeep == 10000){
hud.setWave(15);
handler.addObject(new LeftRigthEnemy(r.nextInt(Game.WIDTH - 22), Game.HEIGHT - 44, ID.Enemy, Color.orange, handler)); //LeftRightEnemy (BOTTOM)
handler.addObject(new LeftRigthEnemy(r.nextInt(Game.WIDTH - 22), 0, ID.Enemy, Color.orange, handler)); //LeftRightEnemy (TOP)
}
if(scoreKeep == 11000){
hud.setWave(16);
handler.addObject(new UpDownEnemy(0, r.nextInt(Game.HEIGHT - 45), ID.Enemy, Color.orange, handler)); //UpDownEnemy (LEFT)
handler.addObject(new UpDownEnemy(Game.WIDTH - 22, r.nextInt(Game.HEIGHT - 45), ID.Enemy, Color.orange, handler)); //UpDownEnemy (Right)
}
if(scoreKeep == 12000){
hud.setWave(17);
handler.addObject(new VerticallyFastEnemy(r.nextInt(Game.WIDTH - 20), r.nextInt(Game.HEIGHT - 42), ID.Enemy, Color.cyan, handler)); //VerticallyFastEnemy
}
if(scoreKeep == 13000){
hud.setWave(18);
handler.addObject(new HorizontallyFastEnemy(r.nextInt(Game.WIDTH - 20), r.nextInt(Game.HEIGHT - 42), ID.Enemy, Color.green, handler)); //HorizontallyFastEnemy
}
if(scoreKeep == 14000){
hud.setWave(19);
handler.addObject(new SmartEnemy(r.nextInt(Game.WIDTH - 20), r.nextInt(Game.HEIGHT - 42), ID.Enemy, Color.lightGray, handler)); //SmartEnemy
}
if(scoreKeep == 15000){
hud.setWave(20);
handler.clearEnemies();
handler.addObject(new EnemyBoss1(Game.WIDTH / 2 + 38, -155, ID.Enemy, handler)); //EnemyBoss1
}
}
}