diff --git a/core/src/controller/Controller.java b/core/src/controller/Controller.java index f66926e..b770b25 100644 --- a/core/src/controller/Controller.java +++ b/core/src/controller/Controller.java @@ -166,6 +166,7 @@ public class Controller extends ApplicationAdapter implements InputProcessor{ double tempX = level.get(currentChapter).get(currentLevel).getProjectile().getxPos(); double tempY = level.get(currentChapter).get(currentLevel).getProjectile().getyPos(); + /* for(Rectangle rect : gs.getGoalRects()){ if(Intersector.overlaps(gs.getProjectileCirc(), rect) && !collision) { @@ -178,6 +179,7 @@ public class Controller extends ApplicationAdapter implements InputProcessor{ break; } } + */ if(gs.getObjectRectsBottom() != null) { for (Rectangle rect : gs.getObjectRectsBottom()) { diff --git a/core/src/model/Level.java b/core/src/model/Level.java index d4a2fe1..25ebf52 100644 --- a/core/src/model/Level.java +++ b/core/src/model/Level.java @@ -19,7 +19,7 @@ import java.util.ArrayList; public class Level { private final double G = 0.05; private final int RADIUS = 150; - private final double ELOSS = 0.7; + private final double ELOSS = 1; private Goal goal; private Projectile projectile; diff --git a/core/src/view/Gamescreen.java b/core/src/view/Gamescreen.java index 1ffcc87..143420f 100644 --- a/core/src/view/Gamescreen.java +++ b/core/src/view/Gamescreen.java @@ -49,8 +49,7 @@ public class Gamescreen{ ShapeRenderer shapeRenderer; int pivotX; int pivotY; - - Rectangle[] goalRects; + Rectangle goalRect; Circle projectileCirc; // 0: Left, 1: LeftTop, 2: CenterLeft, 3: CenterBottom, 4: CenterRight, 5: RightTop, 6: Right, 7: Bottom @@ -109,18 +108,16 @@ public class Gamescreen{ win = false; - - - goalRects = new Rectangle[8]; - - goalRects[0] = new Rectangle(x ,y ,1 ,h ); - goalRects[1] = new Rectangle(x ,y + h - 1 ,w * th ,1 ); - goalRects[2] = new Rectangle(x + th * w-1f ,y + h * th ,1 ,h * th*4 ); - goalRects[3] = new Rectangle(x + th * w ,y + h * th - 1 ,w *th*3 ,1 ); - goalRects[4] = new Rectangle(x + th*4 * w ,y + h * th ,1 ,h * th*4 ); - goalRects[5] = new Rectangle(x + th*4 * w ,y + h - 1f ,w *th ,1 ); - goalRects[6] = new Rectangle(x + w-1 ,y ,1 ,h ); - goalRects[7] = new Rectangle(x ,y ,w ,1 ); + + // 0: Left, 1: LeftTop, 2: CenterLeft, 3: CenterBottom, 4: CenterRight, 5: RightTop, 6: Right, 7: Bottom + objectRectsLeft.add(new Rectangle(x ,y ,1 ,h )); + objectRectsTop.add(new Rectangle(x ,y + h - 1 ,w * th ,1 )); + objectRectsRight.add(new Rectangle(x + th * w-1f ,y + h * th ,1 ,h * th*4 )); + objectRectsTop.add(new Rectangle(x + th * w ,y + h * th - 1 ,w *th*3 ,1 )); + objectRectsLeft.add(new Rectangle(x + th*4 * w ,y + h * th ,1 ,h * th*4 )); + objectRectsTop.add(new Rectangle(x + th*4 * w ,y + h - 1f ,w *th ,1 )); + objectRectsRight.add(new Rectangle(x + w-1 ,y ,1 ,h )); + objectRectsBottom.add(new Rectangle(x ,y ,w ,1 )); int hitboxWidth = 1; // CHANGE IN STEP TIMER IN CONTROLLER TOO for (Rectangle object : objects) { @@ -255,9 +252,6 @@ public class Gamescreen{ return win; } - public Rectangle[] getGoalRects(){ - return goalRects; - } public Circle getProjectileCirc(){ return projectileCirc; } diff --git a/core/src/view/Leveleditor.java b/core/src/view/Leveleditor.java index 93c47e3..f6547b4 100644 --- a/core/src/view/Leveleditor.java +++ b/core/src/view/Leveleditor.java @@ -65,7 +65,7 @@ public class Leveleditor{ GAME_WORLD_HEIGHT = height; // CREATING LEVEL, TO BE EDITED AND SAVED - level = new Level(new Goal(0, 0, 200, 150, 0.2f), new Projectile(0, 0, 0), 0, 0); + level = new Level(new Goal(0, 0, 250, 140, 0.2f), new Projectile(0, 0, 0), 0, 0); // VARIABLES state = -1;