GammelJan 6 years ago
parent 469c17096c
commit 50b0eb59dd

@ -32,7 +32,7 @@ public class Level {
private int traceIndex; private int traceIndex;
public boolean[] isTraceInitialised; public boolean[] isTraceInitialised;
public Vector2[] traces; public Vector2[] traces;
Rectangle[] objects; ArrayList<Rectangle> objects;
public Level(Goal goal, Projectile projectile, int xPosPivot, int yPosPivot){ public Level(Goal goal, Projectile projectile, int xPosPivot, int yPosPivot){
this.goal = goal; this.goal = goal;
@ -47,10 +47,6 @@ public class Level {
this.angle = 0; this.angle = 0;
this.angleSpeed = 0; this.angleSpeed = 0;
objects = new Rectangle[2];
objects[0] = new Rectangle(500,500,200,50);
objects[1] = new Rectangle(800,500,50,200);
traceIndex = 0; traceIndex = 0;
isTraceInitialised = new boolean[50]; isTraceInitialised = new boolean[50];
traces = new Vector2[isTraceInitialised.length]; traces = new Vector2[isTraceInitialised.length];
@ -151,7 +147,10 @@ public class Level {
public boolean released(){ public boolean released(){
return isReleased; return isReleased;
} }
public Rectangle[] getObjects(){ public ArrayList<Rectangle> getObjects(){
return objects; return objects;
} }
public void addRectangle(int x, int y, int width, int height){
objects.add(new Rectangle(x,y,width,height));
}
} }

@ -51,7 +51,7 @@ public class Gamescreen{
// 0: Left, 1: LeftTop, 2: CenterLeft, 3: CenterBottom, 4: CenterRight, 5: RightTop, 6: Right, 7: Bottom // 0: Left, 1: LeftTop, 2: CenterLeft, 3: CenterBottom, 4: CenterRight, 5: RightTop, 6: Right, 7: Bottom
float GAME_WORLD_WIDTH; float GAME_WORLD_WIDTH;
float GAME_WORLD_HEIGHT; float GAME_WORLD_HEIGHT;
Rectangle[] objects; ArrayList<Rectangle> objects;
ArrayList<Rectangle> objectRects; ArrayList<Rectangle> objectRects;
boolean win; boolean win;
@ -72,8 +72,6 @@ public class Gamescreen{
win = false; win = false;
objectRects = new ArrayList<Rectangle>();
goalRects = new Rectangle[8]; goalRects = new Rectangle[8];

Loading…
Cancel
Save