1 / 24

Creating An Animation Program

Creating An Animation Program. Alice. Recall. We began the animation creation process We introduced the concept of an algorithm We introduced the concept of a storyboard Visual: sketches or screen shots Textual: to-do-list. Today’s Focus. Animation Programming Read scenario

Download Presentation

Creating An Animation Program

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Creating An AnimationProgram Alice

  2. Recall • We began the animation creation process • We introduced the concept of an algorithm • We introduced the concept of a storyboard • Visual: sketches or screen shots • Textual: to-do-list

  3. Today’s Focus • Animation Programming • Read scenario • Design storyboard • Implement • Test results

  4. Implementation • Toimplement the storyboard, translate the actions in the storyboard to a program. • Program (a.k.a. script) • a list of instructions to have the objects perform certain actions in the animation

  5. Writing the Program • Suppose the Scenario is to animate a snowman trying to get the attention of a snowwoman who is having a conversation with another snowwoman. • The planned storyboard (to-do list) might be: • Now the design steps need to be translated into program instructions. Do the following actions in order snowman turns to face snowwoman snowman says something snowwoman turns head snowman “raises eyebrows” snowwoman blushes as she turns head back around

  6. Translating the Design • Some steps in the storyboard can be written as a singleinstruction • The snowman turns to face the snowwoman • Other steps are composite actions that require more than one instruction • Moving the snowman’s eyebrows (eyes) consists of two actions happening together • The left eye moves up and then down • The right eye moves up and then down

  7. Action Blocks in Alice Sequential Action Block Simultaneous Action Block

  8. Writing the Program • In-class example: the implementation process • The finished program: • Ch02Snowpeople

  9. Concepts in this first program • Program instructions may have arguments • Example: for the move instruction, the arguments we used in this example were • direction • distance • DoTogether and DoInOrder blocks can be nested: one inside the other

  10. Testing • An important step in creating a program is to run it – to be sure it does what you expect it to do. • We recommend that you use an incremental development process: • write a few lines of code and then run it • write a few more lines and run it • write a few more lines and run it… • This process allows you to find any problems and fix them as you go along.

  11. Comments • While Alice instructions are easy to understand, a particular combination of the instructions may perform an action that is not immediately obvious. • Comments are used to document the code – explain the purpose of a particular segment of the program to the human reader.

  12. Demo • Ch02SnowpeoplewithComments • Comments in this example world illustrate • description of the action performed by the entire method • description of the purpose of a small segment of code

  13. A working program is not necessarily a well-written program

  14. Chapter 2 Tips & Techniques • Orient to method • Every Alice object has an orientation: a definition of which way is forward, backward, etc. • Not all objects have the same orientation • When 2 objects need to move together, use the orient to method to get them oriented the same way • Each object must be given a move instruction

  15. Chapter 2 Tips & Techniques • The vehicle property • Another way to get two objects to move together in the SAME direction • Select the rider object and the properties tab • Select the other object to be the vehicle • When an instruction is given to move the vehicle, the rider moves with. • The rider may move independently of the vehicle, however.

  16. Chapter 2 Tips & Techniques • Arguments • Duration: default is 1 second • Style: how movements blend together – may help the “smoothness” of your animation • Gently (begin and end), begin gently, end gently • Abruptly (begin and end), begin abruptly, end abruptly • asSeenBy • Controls the movement of an object relative to another, such as the ground, rather than moving the object according to its orientation

  17. Chapter 2 Tips & Techniques • turn to face method • Pivots an object until its front is facing the other object • point at method • also turns an object to face another, but their centers are aligned • can cause a tipping effect if the two centers are at different heights • adjusting the onlyAffectYaw to be true makes this method equivalent to turn to face

  18. Chapter 2 Tips & Techniques • move to method • moves one object to another so that their centers meet • could cause a collision • move toward method lets you specify how far to move

  19. Saving Your WorkUSB Drives • Flash/USB drive • Name your drive • Go to My Computer • Locate the drive (probably E:\) • Right-click and choose rename • Give it your name (also helpful if you forget it somewhere!) • Be sure the drive is inserted before starting Alice

  20. Saving Your WorkUSB Drives • Properly eject the USB drive by clicking on the Safely Remove Hardware button in the notification area of the taskbar (lower right corner)

  21. Saving Your WorkUSB Drives

  22. Saving Your WorkUNCW Student Servers • Student FTP – this uses your space for UNCW student web pages - http://www.uncw.edu/itsd/students/ieupload.htm • Timmy Server – http://www.uncw.edu/itsd/students/studentfilesrv.htm

  23. Assignment • Read Chapter 2 Tips and Techniques, and Chapter 3, Section 1: Built-in functions and expressions

  24. Lab • Chapter 2 Section 2 Lab

More Related