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

import java.util.*;

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

    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);
        velocity.updateByMove(value);
    }

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