-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLevelOne
82 lines (71 loc) · 1.92 KB
/
LevelOne
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
package wave;
import org.lwjgl.input.Mouse;
import java.awt.Font;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import org.newdawn.slick.AppGameContainer;
import org.newdawn.slick.BasicGame;
import org.newdawn.slick.Color;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Image;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.TrueTypeFont;
import org.newdawn.slick.geom.Vector2f;
import org.newdawn.slick.opengl.Texture;
import org.newdawn.slick.opengl.TextureLoader;
import grid.Waypoint;
import main.Game;
import java.util.*;
import playerObjects.*;
public class LevelOne {
static int i = 0;
static float x = 0;
static float y = 0;
static float tot = 0;
static Enemy e;
static ArrayList<Enemy> es;
static Enemy[] wave = new Enemy[30];
public static ArrayList<Enemy> levelOne(int milli) throws FileNotFoundException, IOException
{
Vector2f startingLoc = new Vector2f(46, 46);
tot += milli;
Vector2f vel = new Vector2f(38, 38);
if(i == 0) {
Texture Elfy = TextureLoader.getTexture("png", new FileInputStream(new File("./res/HouseElf.png")));
Vector2f size = new Vector2f(1, 1);
Icon img = new Icon(new Image(Elfy), size);
Vector2f loc = startingLoc;
for(int j = 0; j< wave.length; j++) {
wave[j] = new HouseElf(loc, vel, size, img);
}
}
ArrayList<Enemy> es = new ArrayList<Enemy>();
for(Enemy e: wave) {
es.add(e);
}
/* while(tot > 250)
{ tot = 0;
if((i %= 2) == 0)
{
//y += 1;
x = 0;
y = 4;
i++;
}
else
{
//x += 1;
x = 4;
y = 0;
i++;
}
}
vel = new Vector2f(x*38, y*38);
e.setLoc(e.getLoc().add(vel.scale((float)milli/1000))); */
//e.setLoc(new Vector2f((e.getLoc().x + x*5), e.getLoc().y+y*5));
//What does this do?
return es;
}
}