Jan Ehehalt 6 years ago
parent ba33ff4e60
commit 423f01ec5b

@ -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()) {

@ -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;

@ -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;
}

@ -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;

Loading…
Cancel
Save