Commit a3791ebf authored by Sergio Emanuel Rodriguez Rivera's avatar Sergio Emanuel Rodriguez Rivera
Browse files

fixed scoring

parent e54cde7c
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -71,6 +71,10 @@ public class ObstacleField {
        obstacleBounds.add(o.getShape().getBoundsInParent());
    }

    public void removeField(Obstacle o){
        obstacles.remove(o);
    }

    private int windowSize, obSize;
    private int xTranslation,yTranslation,zTranslation;
    Set<String> occupiedPositions = new HashSet<>();
+5 −2
Original line number Diff line number Diff line
@@ -66,8 +66,8 @@ public class GraphicsAndWindowsTest extends Application {


        ObstacleField obs = new ObstacleField(sceneWindow.getWindowSize(),sceneWindow.getXOffset(),
                sceneWindow.getYOffset(),300,-250, 1000, 0, "Box",
                Color.ORANGERED, false);
                sceneWindow.getYOffset(),300,0, 50, 100, "Box",
                Color.ORANGERED, true);

        String[] ob2 = {"--image", "src/teapot.txt", "--speed", "32", "--dir", "4,", "7,", "10"};
        String[] ob3 = {"--image", "src/teapot.txt", "--speed", "5", "--dir", "1,", "1,", "1"};
@@ -349,6 +349,9 @@ public class GraphicsAndWindowsTest extends Application {
                            switch ((String)collisionSide.get(0)){
                                case "REMOVABLE":
                                    Obstacle o = ((Obstacle) collisionSide.get(1));
                                    group3D.getChildren().remove(o.getShape());
                                    obs.removeField(o);
                                    score = score+5;
                                    break;

                                case "LEFT":