Newer
Older
JumpingGame / src / main / java / entities / Force.java
k-fujii on 15 Nov 2021 398 bytes entity→entitiesに変更
package entities;

public class Force {
    private Acceleration acceleration;
    private Pair<Double> value;

    public Force(Acceleration acceleration) {
        this.acceleration = acceleration;
    }

    public void gravity(double y) {
        this.value = new Pair(0.0, y);
        acceleration.updateByForce(value);
    }

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