diff --git a/GameProject/src/controller/ReboundController.java b/GameProject/src/controller/ReboundController.java new file mode 100644 index 0000000..fcbae09 --- /dev/null +++ b/GameProject/src/controller/ReboundController.java @@ -0,0 +1,18 @@ +package controller; + +public class ReboundController extends ObjectController{ + + @Override + public void updateObject() { + if(this.gameObject.getX() < 30 && this.gameObject.getX() > 670) { + double vx = this.gameObject.getX(); + this.gameObject.setVX(vx * -1); + } else if (this.gameObject.getY() < 30 && this.gameObject.getY() > 670) { + double vy = this.gameObject.getX(); + this.gameObject.setVX(vy * -1); + } + + + } + +}