Time for action – modifying an animation's frame durations

The game file to import and load for this session is 5961_05_03.stencyl.

  1. Ensure that we can see the new frames for the Blinking Statue animation by clicking on the Dashboard tab, then selecting Actor Types and double-clicking on the Stencyl Book Statue icon.
  2. In the Animations panel, note that we can see the miniature animation for the Blinking Statue looping through each frame very quickly.
  3. In the main panel, double-click on the statue with frame number 0 (zero) to open the Edit Frame dialog box.
  4. Change Duration (in milliseconds) from 100 to 1000.
  5. Click on the OK button.
  6. In the Animations panel, note that we can immediately see the change in the statue's frame duration for the frame that we changed.
  7. Change the duration of frame number 4 to 1000.
  8. Test the game!

What just happened?

We have changed the display duration for two specific frames within the animation.

Firstly, we modified frame 0 to have a duration of 1000 milliseconds, which is equal to one second, and then we repeated the process for frame 4.

As soon as we closed the Edit Frame dialog box by clicking the OK button, the miniature representation of the animation in the Animations panel was updated, so that we could see how our changes had affected the animation.

Because we were only modifying two of the frames, it was a quick process to change them one at a time. However, if we need to change multiple consecutive frames, we can click on the first frame in the sequence, hold the Shift key on the keyboard, and then click on the last frame in the sequence, which will select the series of frames. We can then click on the Edit Frame button at the lower-center of the screen to display the Edit Duration (Multiple Frames) dialog box. At this point, we can enter a new duration for all of the selected frames, and they will all be updated immediately when the OK button is clicked.

Have a go hero

The game file to import and load for this session is 5961_05_04.stencyl.

We've changed the frame duration for frames 0 and 4, and we have also learned how to select and modify the duration of multiple consecutive frames.

Have a go at using these skills to make the statue open its eyes slowly once, then close them again before it fades away.

It may take some experimentation to get the timing just right, so be patient. When the task is complete, ask someone to provide feedback on whether or not they think the effect is successful.

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

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