Newer
Older
JumpingGame / src / main / java / resources / Position.java
package resources;

public class Position {
    private Ground ground;
    private Pair<Double> value;

    public void updateByVelocity(Pair<Double> velocity) {
        Pair temp_l3;
        if (((this.ground.getValue() == true) && ((this.value.getSecond() + (0.01 * velocity.getSecond())) < 0.0))) {
            temp_l3 = new Pair((this.value.getFirst() + (0.01 * velocity.getFirst())), 0.0);
        } else {
            temp_l3 = new Pair((this.value.getFirst() + (0.01 * velocity.getFirst())), (this.value.getSecond() + (0.01 * velocity.getSecond())));
        }
        value = temp_l3;
    }

    public Position(Ground ground) {
        this.ground = ground;
    }

    public Pair<Double> getValue() {
        return value;
    }
}