use of com.ilargia.games.entitas.core.CoreEntity in project Entitas-Java by Rubentxu.
the class MoveSystem method execute.
@Override
public void execute(float deltatime) {
for (CoreEntity e : _group.getEntities()) {
Motion motion = e.getMotion();
View view = e.getView();
if (view.shape instanceof Rectangle) {
Rectangle ret = (Rectangle) view.shape;
ret.setPosition(ret.x + motion.velocity.x * Gdx.graphics.getDeltaTime(), ret.y + motion.velocity.y * Gdx.graphics.getDeltaTime());
} else {
Circle circle = (Circle) view.shape;
circle.setPosition(circle.x + motion.velocity.x * Gdx.graphics.getDeltaTime(), circle.y + motion.velocity.y * Gdx.graphics.getDeltaTime());
}
}
}
Aggregations