1 / 20

Alice and Media Computation August 2009

Alice and Media Computation August 2009. Animation Storyboard  Code. Steve Cooper Barbara Ericson. Traditional Problem Solving in CS. Read and understand the problem or task specification Design a solution (develop an algorithm) Implement (code) Test Revise, as needed.

valin
Download Presentation

Alice and Media Computation August 2009

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. Alice and Media Computation August 2009 Animation Storyboard  Code Steve Cooper Barbara Ericson

  2. Traditional Problem Solving in CS • Read and understand the problem or task specification • Design a solution (develop an algorithm) • Implement (code) • Test • Revise, as needed

  3. Designing a Solution in Alice • To create a design, we borrow the idea of storyboardsfrom professional animators at Disney, Pixar, etc.

  4. Recall…. • Princess Escape A princess has been grounded by her father (a wizard). Being a rather rebellious princess, she has emailed the local dragon taxi service. The dragon will fly to the princess and she will climb aboard the dragon to escape from the castle – to meet some friends at the village dance club.

  5. Visual Storyboards

  6. Textual Storyboard(pseudo code) Do in order dragon takes off dragon flies to princess princess climbs on dragon's back dragon and princess escape knight shakes his arm (and sword) in protest

  7. Implementing a program in Alice • Create the program instructions using the drag and drop editor • We recommend an incremental development approach • write a method • test it • and so on….

  8. Stepwise refinement - 1 Do in order dragon takes off dragon flies to princess princess climbs on dragon's back dragon and princess escape knight shakes his arm (and sword) in protest • How can a dragon "take off"? Do together dragon moves up dragon flaps wings

  9. Stepwise refinement - 2 • How can a dragon flap its wings? Do together dragon moves up dragon flaps wings Do together dragon flap left wing dragon flap right wing

  10. Stepwise refinement - 3 Do together dragon flap left wing dragon flap right wing • How can a dragon flap its left wing? Do in order Do together dragon left wing rolls right dragon left wing flap rolls right Do together dragon left wing rolls left dragon left wing flap rolls left Is this too detailed? Probably, but you get the picture…

  11. Create the flapWings Method 1. Select dragon 2. create new method 3. Name the method

  12. Will flap the left wing and the right wing at the same time So create a flapLeftWing and a flapRightWing method as well Write the flapLeftWing method Do in order Do together dragon left wing rolls right dragon left wing flap rolls right Do together dragon left wing rolls left dragon left wing flap rolls left flapWings

  13. The complete method

  14. Testing flapLeftWing

  15. Your turn! • Create the flapRightWing method Do in order Do together dragon right wing rolls left 0.05 dragon right wing flap rolls left 0.03 Do together dragon right wing rolls right 0.05 dragon right wing flap rolls right 0.03

  16. Create a flapWings method

  17. Your turn! • Create the flapWings method • Create a takeOff method, where the dragon moves up 2 meters and flaps its wings twice • What changes will you need to make to the duration= parameter to get the animation working?

  18. Create a fly method

  19. Adding Comments • Comments are short descriptions of what is happening • Explain confusing bits • Drag up the // tile • Click on the down arrow • Select other • Type the comment

  20. Saving out a new class • Renaming the class • FlyingDragon • Saving it • Right click on it • Save Object • FlyingDragon.a2c • Importing it for a different world • Start Alice • File-Import the class • FlyingDragon.a2c

More Related