You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
347 B

  1. package controller;
  2. public class ReboundController extends ObjectController {
  3. @Override
  4. public void updateObject() {
  5. // TODO Auto-generated method stub
  6. if(this.getX()<30 || this.getX()>670) {
  7. this.setVX(this.getVX()* -1);
  8. }
  9. if(this.getY()<30 || this.getY()>670) {
  10. this.setVY(this.getVY()* -1);
  11. }
  12. this.applySpeedVector();
  13. }
  14. }