The bell animation now is smooth

This commit is contained in:
Seraina 2022-05-13 17:15:09 +02:00
parent 97b460d1d0
commit f279298af1

View File

@ -12,18 +12,20 @@ public class BellAnimation extends Transition {
int index; int index;
public BellAnimation(ImageView imageView, Image[] bells) { public BellAnimation(ImageView imageView, Image[] bells) {
setCycleCount(17); setCycleCount(16);
index = 0; index = 0;
this.imageView = imageView; this.imageView = imageView;
this.bells = bells; this.bells = bells;
setCycleDuration(new Duration(59)); setCycleDuration(new Duration(100));
setInterpolator(Interpolator.DISCRETE); setInterpolator(Interpolator.DISCRETE);
} }
@Override @Override
protected void interpolate(double frac) { protected void interpolate(double frac) {
imageView.setImage(bells[index]); if(index < 17) {
imageView.setImage(bells[index]);
}
index++; index++;
} }
} }