net.mostlyoriginal.api.component.physics.Gravity Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of contrib-jam Show documentation
Show all versions of contrib-jam Show documentation
Jam bundle of systems and components!
The newest version!
package net.mostlyoriginal.api.component.physics;
import com.artemis.Component;
import java.io.Serializable;
/**
* Apply gravity to entity.
*
* @author Daan van Yperen
* @see net.mostlyoriginal.api.system.physics.GravitySystem
*/
public class Gravity extends Component implements Serializable {
public static final float DEFAULT_Y_GRAVITY = -9.8f;
// x axis gravity
public float x = 0;
// y axis gravity
public float y = DEFAULT_Y_GRAVITY;
public Gravity() {}
public Gravity(float y) {
this.y = y;
}
public void set(float x, float y) { this.x=x; this.y=y;}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy