use of com.b3dgs.lionengine.AnimatorFrameListener in project lionengine by b3dgs.
the class CollidableFramedModel method recycle.
/*
* CollidableFramed
*/
@Override
public void recycle() {
for (final Collision collision : config.getCollisions()) {
collidable.addCollision(collision);
collidable.setEnabled(false, collision);
}
animatable.addListener((AnimatorFrameListener) frame -> {
for (final Collision collision : last) {
collidable.setEnabled(false, collision);
}
last = config.getCollision(Integer.valueOf(frame));
for (final Collision collision : last) {
collidable.setEnabled(true, collision);
collidable.forceUpdate();
}
});
}
Aggregations