if (attributes.getValue(CURVE).equalsIgnoreCase(LINEAR)) {
curve = Animation.EASINGCURVE_LINEAR;
}
Animation animation = null;
// Check if the animation is a TRANSLATE
if (attributes.getValue(TYPE).equalsIgnoreCase(TRANSLATE)) {
animation =
parseTranslationAnimation(enemy, keyframes, keyTimes,
duration, curve, attributes);
}
// Check if the animation is a ROTATE
else if (attributes.getValue(TYPE).equalsIgnoreCase(ROTATE)) {
animation =
parseRotationAnimation(enemy, keyframes, keyTimes,
duration, curve, attributes);
}
// Check if the animation is a SCALE
else if (attributes.getValue(TYPE).equalsIgnoreCase(SCALE)) {
animation =
parseScaleAnimation(enemy, keyframes, keyTimes,
duration, curve, attributes);
}
// Add the animation to the enemy
if (animation != null) {
enemy.addAnimation(animation);
final int repeatCount =
Integer.parseInt(attributes.getValue(REPEAT));
if (repeatCount == -1) {
animation.setRepeatCount(Animation.REPEAT_COUNT_INDEFINITE);
} else {
animation.setRepeatCount(repeatCount);
}
}
}