diff options
Diffstat (limited to 'src/main/java/fr')
-rw-r--r-- | src/main/java/fr/umlv/java/wallj/controller/StagePhysicsController.java | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/main/java/fr/umlv/java/wallj/controller/StagePhysicsController.java b/src/main/java/fr/umlv/java/wallj/controller/StagePhysicsController.java index 0846584..6719302 100644 --- a/src/main/java/fr/umlv/java/wallj/controller/StagePhysicsController.java +++ b/src/main/java/fr/umlv/java/wallj/controller/StagePhysicsController.java | |||
@@ -17,17 +17,15 @@ public class StagePhysicsController implements Controller { | |||
17 | private static final int POSITION_TICK_PER_MS = 2; | 17 | private static final int POSITION_TICK_PER_MS = 2; |
18 | 18 | ||
19 | private final Stage stage; | 19 | private final Stage stage; |
20 | private final World world; | ||
21 | 20 | ||
22 | public StagePhysicsController(Stage stage) { | 21 | public StagePhysicsController(Stage stage) { |
23 | this.stage = Objects.requireNonNull(stage); | 22 | this.stage = Objects.requireNonNull(stage); |
24 | this.world = new World(new Vec2()); | ||
25 | } | 23 | } |
26 | 24 | ||
27 | @Override | 25 | @Override |
28 | public List<Event> update(Context context) { | 26 | public List<Event> update(Context context) { |
29 | int dt = (int) context.getTimeDelta().toMillis(); | 27 | int dt = (int) context.getTimeDelta().toMillis(); |
30 | world.step(dt, dt * VELOCITY_TICK_PER_MS, dt * POSITION_TICK_PER_MS); | 28 | stage.getWorld().step(dt, dt * VELOCITY_TICK_PER_MS, dt * POSITION_TICK_PER_MS); |
31 | return null; | 29 | return null; |
32 | } | 30 | } |
33 | 31 | ||