Your assignment is to create a tiered stage full of animated dancers and to animate those dancers as you choose. It should appear generally like the picture shown here:
Step 1
You should first ask the user for how many tiers there should be on your stage. The user should be allowed to enter any number between 1 and 5. If they enter an incorrect number you should ask again.
You should next ask the user for the number of dancers on each tier. This should be a number between 1 and 5. If they enter an incorrect number you should ask again as many times as are necessary to get a correct input.
Step 2
Create a class called Tier that will create one level of the stage and its dancers. The Tier should be wide enough to hold the correct number of dancers and placed at the correct level and position. You can do this in Tier's constructor. You should test your program at this point to see if the tiers all appear correctly and you have a suitable look-at/look-from setup.
Step 3
Create a class called Dancer that is a subclass of MaleBody. Design three different poses for your dancer: poseA, poseB and poseC. A pose is defined as a particular set of angles for elbows, knees, hips, head nod, eye position etc. Your poses can be anything that you want provided your set of poses cover leg movement, arm movement (sholder, elbow and hand) as well as head movement. I would test these poses by creating the methods setPoseA(), setPoseB() and setPoseC() on the class Dancer. You should modifiy your Tier class to place the dancers on it. I would also use the setScale(double) method to reduce the size of the dancers.
Step 4
Add the methods setPoseAtoB(double), setPoseBtoC(double) and setPoseCtoA(double) to your Dancer class. The purpose of these methods is to set the pose somewhere between the key poses A, B and C. For example
- setPoseAtoB(0.0) will set all of the angles to pose A.
- setPoseAtoB(0.5) will set the pose angles to half way between A and B.
- setPoseAtoB(1.0) will set the pose angles to pose B.
- setPosetAtoB(0.25) will set the pose angles one quarter of the way between A and B.
Once you have these methods you can ask your dancer to assume any pose that is part way between any of the three key poses that you created in step 3.
Step 5
Modify your Tier class to have the same methods in step 4 and have those methods call the methods on each Dancer in the Tier. This will allow you to pose every dancer on the Tier all the same.
Step 6
Create a main() method that will ask the user for the inputs in step 1, set up the tiers and then use the pose methods to animate all of the dancers in all of the tiers to perform some dance of your choosing. You should use other methods so that your main() is not one long stretch of code. You should break down your problem appropriately with methods for each major step.
Your animation will be a series of loops that vary the pose parameter between 0 and 1 to move the dancer between poses.