Nour
3 years ago
6 changed files with 100 additions and 23 deletions
-
1GameProject/src/base/MovingObjectsGame.java
-
18GameProject/src/base/MultiLevelGame.java
-
24GameProject/src/controller/ReboundController.java
-
4GameProject/src/log4j2.xml
-
49GameProject/src/playground/LevelMovingHitObjects.java
-
19GameProject/src/playground/LevelMovingObjects.java
@ -0,0 +1,24 @@ |
|||||
|
package controller; |
||||
|
|
||||
|
public class ReboundController extends ObjectController{ |
||||
|
|
||||
|
@Override |
||||
|
|
||||
|
public void updateObject() { |
||||
|
|
||||
|
if (this.getX() < 30 || this.getX() > 670 ) { |
||||
|
|
||||
|
setVX(getVX() * -1) ; |
||||
|
} |
||||
|
|
||||
|
if (getY() < 30 || getY() > 670 ) { |
||||
|
|
||||
|
setVY(getVY() * -1) ; |
||||
|
} |
||||
|
super.applySpeedVector(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue