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