Newer
Older
JumpingGame / src / main / java / entities / Move.java
package entities;

public class Move {
    private Velocity velocity;
    private Pair<Double> value = new Pair<>(0d, 0d);

    public Move(Velocity velocity) {
        this.velocity = velocity;
    }

    public void moveX(double x) {
        this.value = new Pair(x, this.value.getSecond());
        velocity.updateByMove(value);
    }

    public void moveY(double y) {
        this.value = new Pair(this.value.getFirst(), y);
    }

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