use of com.ilargia.games.logicbrick.component.Motion in project Entitas-Java by Rubentxu.
the class CoreEntity method replaceMotion.
public CoreEntity replaceMotion(float x, float y) {
Motion component = (Motion) recoverComponent(CoreComponentsLookup.Motion);
if (component == null) {
component = new Motion(x, y);
} else {
component.velocity = new Vector2(x, y);
}
replaceComponent(CoreComponentsLookup.Motion, component);
return this;
}
Aggregations