From e54cde7c60417e79b087985c7925004afc8ed599 Mon Sep 17 00:00:00 2001 From: SergioRodriguezRivera Date: Mon, 15 Apr 2024 17:26:37 -0400 Subject: [PATCH] renamed immovable --- src/main/java/Shape/Obstacle.java | 14 ++++---------- .../newmat/GraphicsAndWindowsTest.java | 4 ++++ target/classes/Shape/MovingObject.class | Bin 6113 -> 6251 bytes 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/main/java/Shape/Obstacle.java b/src/main/java/Shape/Obstacle.java index 9fb463a..321530d 100644 --- a/src/main/java/Shape/Obstacle.java +++ b/src/main/java/Shape/Obstacle.java @@ -1,18 +1,12 @@ package Shape; import javafx.geometry.Bounds; -import javafx.geometry.Point3D; import javafx.scene.Group; import javafx.scene.Node; import javafx.scene.paint.Color; import javafx.scene.paint.PhongMaterial; import javafx.scene.shape.*; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Random; -import java.util.Set; - public class Obstacle { public Obstacle(int WindowSize, double xTranslation, double yTranslation, @@ -27,7 +21,7 @@ public class Obstacle { this.shape.setTranslateX(xTranslation); this.shape.setTranslateY(yTranslation); this.shape.setTranslateZ(zTranslation); - this.immovable = immovable; + this.removable = immovable; shapeBound = this.shape.getBoundsInParent(); } @@ -55,8 +49,8 @@ public class Obstacle { } public String checkCollision(Bounds otherBounds) { if (shapeBound.intersects(otherBounds)) { - if(immovable){ - return "IMMOVABLE"; + if(removable){ + return "REMOVABLE"; } double deltaX = Math.min(shapeBound.getMaxX() - otherBounds.getMinX(), otherBounds.getMaxX() - shapeBound.getMinX()); double deltaY = Math.min(shapeBound.getMaxY() - otherBounds.getMinY(), otherBounds.getMaxY() - shapeBound.getMinY()); @@ -85,7 +79,7 @@ public class Obstacle { } return "NONE"; } - boolean immovable; + boolean removable; int WindowSize = 0; double xTranslation, yTranslation, zTranslation; Node shape; diff --git a/src/main/java/org/example/newmat/GraphicsAndWindowsTest.java b/src/main/java/org/example/newmat/GraphicsAndWindowsTest.java index 3fa49f9..6b52f04 100644 --- a/src/main/java/org/example/newmat/GraphicsAndWindowsTest.java +++ b/src/main/java/org/example/newmat/GraphicsAndWindowsTest.java @@ -347,6 +347,10 @@ public class GraphicsAndWindowsTest extends Application { if(!(collisionSide.get(0).equals("NONE"))){ Bounds obBounds = ((Obstacle) collisionSide.get(1)).getShape().getBoundsInParent(); switch ((String)collisionSide.get(0)){ + case "REMOVABLE": + Obstacle o = ((Obstacle) collisionSide.get(1)); + break; + case "LEFT": direction[i][0] = abs(direction[i][0]); break; diff --git a/target/classes/Shape/MovingObject.class b/target/classes/Shape/MovingObject.class index b14093e20c6c9a96e16661294bffc3252f808910..5ad79ff0a63f412a6d82699826faea931bc4dadc 100644 GIT binary patch delta 796 zcmYjP*-leY6kYqa(1{j$O9z4hdnrSU3RILK8ca+iK1gC8icu0D8WIr$G1eH+T89KR zVjPY*5jAQ|oF1q}5jB2*A7J8}#z+6asJMD0)q9hB_TAH3Ywz>5<9nz3yksnTJO>!Tu4 zkt#4`h=*U3iNFCSkHLq72w_~R=t*dQSiIun9~(&+yCB+%(6VW(j#dRB8&FvSR$u(_ z`U!Y3se4rEeBWvhkwz6WEjg?P&GeQm5sxB*EE;f3XNO?$T_bBHs_Pp6)`>+V7mS}I z`~&rbX;Pof+`u%da2x@gKnrr{!$}Mvk0G2w3a2rQGuVf-<;K8BS;~mSq*=`cb~ewz zjdSdI9#LHQkFr&!+#;>YRvVL9)mHl{e}$y4q8iuWha&cMj%yBexPc^Yq8GQw;Wh?w zhdk!72Y0a__mN?I3=c4khnU49+{0sym4cHs?b0Rz@<^hK(gT!Qjmr|JIw8s>Nzi8y z>!O5JF4(laG>(2$t{?`N15Ssu8+>>Om-7pjVbn0_Lgl|8u!3#~9jp~ur@jUE`k!#Y zPZ7j3&hI&T@InoR!mjmPhcIV@nh3qmFR-G38oZ>&A}lOo2VQZuuQ7uqDt<$y%VjOY z*d`t1?Pk<3oxBpCWVP delta 671 zcmYk4%S)6|7{-6^mpL~_olBEpIL$a(W~F1A8ih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