From 50b0eb59ddb518cc9642097a37274d3e1f229cb8 Mon Sep 17 00:00:00 2001 From: GammelJan Date: Fri, 19 Jun 2020 22:27:17 +0200 Subject: [PATCH] lol --- core/src/model/Level.java | 11 +++++------ core/src/view/Gamescreen.java | 4 +--- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/core/src/model/Level.java b/core/src/model/Level.java index 5c542e6..bdc7579 100644 --- a/core/src/model/Level.java +++ b/core/src/model/Level.java @@ -32,7 +32,7 @@ public class Level { private int traceIndex; public boolean[] isTraceInitialised; public Vector2[] traces; - Rectangle[] objects; + ArrayList objects; public Level(Goal goal, Projectile projectile, int xPosPivot, int yPosPivot){ this.goal = goal; @@ -47,10 +47,6 @@ public class Level { this.angle = 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; isTraceInitialised = new boolean[50]; traces = new Vector2[isTraceInitialised.length]; @@ -151,7 +147,10 @@ public class Level { public boolean released(){ return isReleased; } - public Rectangle[] getObjects(){ + public ArrayList getObjects(){ return objects; } + public void addRectangle(int x, int y, int width, int height){ + objects.add(new Rectangle(x,y,width,height)); + } } diff --git a/core/src/view/Gamescreen.java b/core/src/view/Gamescreen.java index 060ef03..8e81544 100644 --- a/core/src/view/Gamescreen.java +++ b/core/src/view/Gamescreen.java @@ -51,7 +51,7 @@ public class Gamescreen{ // 0: Left, 1: LeftTop, 2: CenterLeft, 3: CenterBottom, 4: CenterRight, 5: RightTop, 6: Right, 7: Bottom float GAME_WORLD_WIDTH; float GAME_WORLD_HEIGHT; - Rectangle[] objects; + ArrayList objects; ArrayList objectRects; boolean win; @@ -72,8 +72,6 @@ public class Gamescreen{ win = false; - objectRects = new ArrayList(); - goalRects = new Rectangle[8];