Browse Source

Hausaufgabe 5 - Aufgabe 3

main
Manu 2 years ago
parent
commit
8ff1e2f444
  1. 18
      GameProject/src/controller/ReboundController.java

18
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);
}
}
}
Loading…
Cancel
Save