Hello I'm trying to create a boss for my game. Unlike most bosses I've ever made, I'm trying to animate the boss by using different subclasses in one class known as "Boss" (see image below for a depiction of the boss class).
But I noticed the inconsistency of my animation for both of the arms. On the left arm, LA2 and LAH seem to be alright (despite it being a little bit choppy), while RAH and RA2 seem to not be in synced at all. It feels so choppy and disgusting when I tried running the scenario with the animation scripts. I'm wondering if anyone knows how to make it where LAH can move in motion with LA2 in a less choppier way.
Here's the line of code inside LA2. That's where the animation is taking place. I apologize in advance for my messy and unorganized coding.
Also if you wanna know what the boss looks like, here he is.

But I noticed the inconsistency of my animation for both of the arms. On the left arm, LA2 and LAH seem to be alright (despite it being a little bit choppy), while RAH and RA2 seem to not be in synced at all. It feels so choppy and disgusting when I tried running the scenario with the animation scripts. I'm wondering if anyone knows how to make it where LAH can move in motion with LA2 in a less choppier way.
Here's the line of code inside LA2. That's where the animation is taking place. I apologize in advance for my messy and unorganized coding.
public class LA2 extends LeftArm
{
int rot = 225;
int delay = 0;
// scrapped variables
int slowdelay = 1;
int waitlel = 5;
boolean isDown = false;
String rotMode = "up";
LAH lefthand;
public LA2 (LAH lah) {
//super();
GreenfootImage image = getImage();
image.scale(521,100);
setImage(image);
lefthand = lah;
setRotation(225);
}
public void act()
{
if (isAttacking == false && delay == 0 && isDown == false) {
if (rot <= 235 && rotMode == "down") {
setRotation(rot + 1);
lefthand.setRotation(-rot - 1);
lefthand.setLocation(lefthand.getX()-2,lefthand.getY()+2);
//setLocation(getX()-1,getY()+2);
rot = rot + 1;
if (rot == 235) {
// for (int lel = 0;lel<=10;lel++) {
// rot--;
// }
rotMode = "up";
slowdelay = 1;
waitlel = 5;
isDown = true;
}
delay = 1;
if (slowdelay != 2 && waitlel <= 0) {
slowdelay++;
} else {
waitlel--;
}
} else if (rot >= 215 && rotMode == "up") {
setRotation(rot - 1);
lefthand.setRotation(-rot + 1);
lefthand.setLocation(lefthand.getX()+2,lefthand.getY()-2);
rot--;
//setLocation(getX()+1,getY()-2);
if (rot == 215) {
// for (int lel = 0;lel<=10;lel++) {
// rot++;
// }
rotMode = "down";
slowdelay = 1;
waitlel = 5;
isDown = true;
}
delay = 1;
if (slowdelay != 2 && waitlel <= 0) {
slowdelay++;
} else {
waitlel--;
}
}
} else if (delay != 0) {
delay--;
} else if (isDown == true) {
delay = 1;
isDown = false;
}
}
}


