-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSpawn.java
More file actions
105 lines (97 loc) · 3.37 KB
/
Spawn.java
File metadata and controls
105 lines (97 loc) · 3.37 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
package com.tutorial.main;
import java.util.Random;
public class Spawn
{
private Handler handler;
private HUD hud;
private Game game;
private Random r = new Random();
private int scoreKeep = 0;
public Spawn(Handler handler, HUD hud, Game game)
{
this.handler = handler;
this.hud = hud;
this.game = game;
}
public void tick()
{
scoreKeep++;
if(scoreKeep >= 250) //when to go up level
{
scoreKeep = 0;
hud.setLevel(hud.getLevel() + 1);
if(game.diff == 0)
{
if(hud.getLevel() == 2)
{
handler.addObject(new BasicEnemy(r.nextInt(Game.WIDTH), r.nextInt(Game.HEIGHT), ID.BasicEnemy, handler));
}
else if(hud.getLevel() == 3)
{
handler.addObject(new BasicEnemy(r.nextInt(Game.WIDTH), r.nextInt(Game.HEIGHT), ID.BasicEnemy, handler));
}
else if(hud.getLevel() == 4)
{
handler.addObject(new FastEnemy(r.nextInt(Game.WIDTH), r.nextInt(Game.HEIGHT), ID.FastEnemy, handler));
}
else if(hud.getLevel() == 5)
{
handler.addObject(new SmartEnemy(r.nextInt(Game.WIDTH), r.nextInt(Game.HEIGHT), ID.SmartEnemy, handler));
}
else if(hud.getLevel() == 6)
{
handler.addObject(new FastEnemy(r.nextInt(Game.WIDTH), r.nextInt(Game.HEIGHT), ID.FastEnemy, handler));
}
else if(hud.getLevel() == 7)
{
handler.addObject(new FastEnemy(r.nextInt(Game.WIDTH), r.nextInt(Game.HEIGHT), ID.FastEnemy, handler));
}
else if(hud.getLevel() == 10)
{
handler.clearEnemies();
handler.addObject(new Boss1((Game.WIDTH / 2) - 48, -170, ID.Boss1, handler));
}
}else if(game.diff == 1)
{
if(hud.getLevel() == 2)
{
handler.addObject(new HardEnemy(r.nextInt(Game.WIDTH), r.nextInt(Game.HEIGHT), ID.BasicEnemy, handler));
}
else if(hud.getLevel() == 3)
{
handler.addObject(new HardEnemy(r.nextInt(Game.WIDTH), r.nextInt(Game.HEIGHT), ID.BasicEnemy, handler));
}
else if(hud.getLevel() == 4)
{
handler.addObject(new FastEnemy(r.nextInt(Game.WIDTH), r.nextInt(Game.HEIGHT), ID.FastEnemy, handler));
}
else if(hud.getLevel() == 5)
{
handler.addObject(new SmartEnemy(r.nextInt(Game.WIDTH), r.nextInt(Game.HEIGHT), ID.SmartEnemy, handler));
}
else if(hud.getLevel() == 6)
{
handler.addObject(new FastEnemy(r.nextInt(Game.WIDTH), r.nextInt(Game.HEIGHT), ID.FastEnemy, handler));
}
else if(hud.getLevel() == 7)
{
handler.addObject(new FastEnemy(r.nextInt(Game.WIDTH), r.nextInt(Game.HEIGHT), ID.FastEnemy, handler));
}
else if(hud.getLevel() == 10)
{
handler.clearEnemies();
handler.addObject(new Boss1((Game.WIDTH / 2) - 48, -170, ID.Boss1, handler));
}
else if(hud.getLevel() == 16)
{
handler.clearEnemies();
handler.addObject(new HardEnemy(r.nextInt(Game.WIDTH), r.nextInt(Game.HEIGHT), ID.BasicEnemy, handler));
handler.addObject(new HardEnemy(r.nextInt(Game.WIDTH), r.nextInt(Game.HEIGHT), ID.BasicEnemy, handler));
handler.addObject(new HardEnemy(r.nextInt(Game.WIDTH), r.nextInt(Game.HEIGHT), ID.BasicEnemy, handler));
handler.addObject(new HardEnemy(r.nextInt(Game.WIDTH), r.nextInt(Game.HEIGHT), ID.BasicEnemy, handler));
handler.addObject(new HardEnemy(r.nextInt(Game.WIDTH), r.nextInt(Game.HEIGHT), ID.BasicEnemy, handler));
}
}
}
}
}