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.
20 lines
360 B
20 lines
360 B
package controller;
|
|
|
|
public class ReboundController extends ObjectController {
|
|
|
|
@Override
|
|
public void updateObject() {
|
|
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();
|
|
|
|
|
|
}
|
|
|
|
}
|