diff --git a/jumpGame.iml b/jumpGame.iml index 6ba17f4..273d838 100644 --- a/jumpGame.iml +++ b/jumpGame.iml @@ -25,5 +25,6 @@ + \ No newline at end of file diff --git a/src/main/java/models/JumpGameModel.java b/src/main/java/models/JumpGameModel.java index 6f35976..41b04fd 100644 --- a/src/main/java/models/JumpGameModel.java +++ b/src/main/java/models/JumpGameModel.java @@ -63,16 +63,60 @@ return flags; } - public Position getPosition() { - return position; + public Pair getPosition() { + return position.getValue(); } - public Velocity getVelocity() { - return velocity; + public void moveX(double x) { + this.move.moveX(x); } - public Ground getGround() { - return ground; + public void moveY(double y) { + this.move.moveY(y); + } + + public void setMass(double x) { + this.mass.setValue(x); + } + + public Pair getAcceleration() { + return acceleration.getValue(); + } + + public Pair getMove() { + return move.getValue(); + } + + public double getMass() { + return mass.getValue(); + } + + public boolean getClear() { + return clear.getClear(); + } + + public boolean getGround() { + return ground.getValue(); + } + + public Pair getForce() { + return force.getValue(); + } + + public Pair getVelocity() { + return velocity.getValue(); + } + + public boolean getOnground() { + return onground.getOnground(); + } + + public double getTime() { + return time.getValue(); + } + + public boolean getGameover() { + return gameover.getGameover(); } //--------------------------------------------------------------- diff --git a/src/main/java/views/PlayerRenderer.java b/src/main/java/views/PlayerRenderer.java index f0a9772..01d154d 100644 --- a/src/main/java/views/PlayerRenderer.java +++ b/src/main/java/views/PlayerRenderer.java @@ -27,7 +27,7 @@ JumpGameModel jumpGameModel = (JumpGameModel) model; double x = this.sprite.getPositionValue().getFirst(); - double y = 112 + jumpGameModel.getPosition().getValue().getSecond(); + double y = 112 + jumpGameModel.getPosition().getSecond(); this.sprite.setPositionValue(new Pair<>(x, y)); } diff --git a/src/main/java/views/TileRenderer.java b/src/main/java/views/TileRenderer.java index 52b9a2d..e8f9f37 100644 --- a/src/main/java/views/TileRenderer.java +++ b/src/main/java/views/TileRenderer.java @@ -51,7 +51,7 @@ public void update(IModel model) { JumpGameModel jumpGameModel = (JumpGameModel) model; - Double x = this.initPositionValue.getFirst() - (jumpGameModel.getPosition().getValue().getFirst() * 64); + Double x = this.initPositionValue.getFirst() - (jumpGameModel.getPosition().getFirst() * 64); Double y = this.sprite.getPositionValue().getSecond(); this.sprite.setPositionValue(new Pair<>(x, y));