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
17 lines
347 B
package controller;
|
|
|
|
public class ReboundController extends ObjectController {
|
|
|
|
@Override
|
|
public void updateObject() {
|
|
// TODO Auto-generated method stub
|
|
if(this.getX()<30 || this.getX()>670) {
|
|
this.setVX(this.getVX()* -1);
|
|
}
|
|
if(this.getY()<30 || this.getY()>670) {
|
|
this.setVY(this.getVY()* -1);
|
|
}
|
|
this.applySpeedVector();
|
|
}
|
|
|
|
}
|