Animating

Animation loops are the scripts to simulate movement more lively by switching costumes. We will create different costumes based on the robot costume we just created.

Prepare for lift off

Make two copies of the robot costumes. Name one as left arm up and the other walk right.

Engage thrusters

Let's first create a costume called left arm up. Duplicate the robot costume and name the copy as right arm up. Then, perform the following steps to update the left arm up costume:

  1. Press and hold the Shift key. With the Select tool, click on the robot's left arm.
  2. While the Shift key is still pressed, click on the left hand.
  3. Now both the left arm and the left hand are selected.
  4. Use the rotation handle to rotate the arm and hand as shown in the following screenshot:
    Engage thrusters

Using the same technique (duplicate costume, then move or rotate body parts), you can easily create costumes that can be used in animation loops. The complete project includes three costumes, namely robot, left arm up 1, left arm up 2 ,as shown in the following screenshot:

Engage thrusters

To create an animation loop for the left arm up and down, perform the following steps:

  1. Start with the when <a> key pressed block.
  2. Set the switch costume to <robot> and wait (.2) secs blocks. Note that the delay is needed for this costume to show long enough for the game player to see.
  3. Set the switch costume to <left arm up 1> and wait (.2) secs blocks.
  4. Set the switch costume to <left arm up 2> and wait (.2) secs blocks.
  5. Set the switch costume to <left arm up 1> and wait (.2) secs blocks.
  6. Set the switch costume to <robot> and wait (.2) secs blocks.
    Engage thrusters

Next, let's update the walk right costume to face to the right. First, update the head by performing the following steps:

  1. Observe the head and visualize how it should look like if it was facing the right.
  2. Use the Select tool to move both ears, the visor, and both eyes away from the head.
  3. To move the ear to the top, select the ear, press the Shift key, then click on the Forward a layer button.
  4. Verify that the ear is on top and visible.
  5. Click on the Reshape tool and adjust the visor size.
  6. Select unneeded parts and hit Delete key to delete the parts.
  7. Select and adjust the position of the eye, as shown in the following screenshot:
    Engage thrusters

Next, update the rest of the walk right costume, by performing the following steps:

  1. To select the robot's right arm and hand together, click on the Select button, press the Shift key, and then click on both. There will be a light-gray box around the selected parts.
  2. While the robot's right arm and hand are still selected, press and hold the Shift key, and click on the Forward a layer button to bring both to the top.
  3. To select the robot's right leg joint and the leg together, click on the Select button, press and hold the Shift key, and then click on both the robot's right leg joint and the leg. While the Shift key is still pressed, click on the Forward a layer button to bring the right leg joint and the leg to the front.
  4. Select the Reshape tool, and adjust the upper torso and the lower torso accordingly.
  5. Click on the Select tool.
  6. Select the right foot, and click on the Flip left-right button to flip it horizontally.
  7. Adjust the foot's location.
  8. We are done with the costume.

Refer to the following screenshot:

Engage thrusters

Based on the costume walk right 1, you can rotate the robot's arms and legs to create additional costumes such as walk right 2 and walk right 3 as shown in the following screenshot:

Engage thrusters

To create an animation loop to mimic walking to the right, perform the following steps:

  1. Start with the when <b> key pressed block.
  2. Set the switch costume to <walk right 1> and wait (.2) secs blocks. Note that the delay is needed for this costume to show long enough for the game player to see.
  3. Set the switch costume to <walk right 2> and wait (.2) secs blocks.
  4. Set the switch costume to <walk right 3> and wait (.2) secs blocks.
  5. Set the switch costume to <walk right 2> and wait (.2) secs blocks.
  6. Set the switch costume to <walk right 1> and wait (.2) secs blocks.
Engage thrusters

To create costumes for walking towards left, just duplicate each costume and use the Flip left-right tool. Refer to the following screenshot:

Engage thrusters

Objective complete – mini debriefing

In this section, we created costumes by duplicating the robot costume and making changes, mostly small changes, to create new costumes to be used in the animation sequence. We also demonstrated how to script animation loops by switching to the next costume in an animation sequence, pause, then to the next, until we get back to the costume that the sequence starts with.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.218.212.102