Download presentation
Presentation is loading. Please wait.
Published byMabel Hensley Modified over 9 years ago
1
Fall 2009ACS-1805 Ron McFadyen1 Chapter 2 Program Design & Implementation
2
Fall 2009ACS-1805 Ron McFadyen2 Creating an Animation Given the description of a story, game, simulation create an Alice animation Or … Given a problem statement, write a program to solve it
3
Fall 2009ACS-1805 Ron McFadyen3 Creating an Animation Recommended approach Read the scenario (requirement statement) Design an animation using storyboards (drawings or textual) and possibly flowcharts Implement your design (translating your design into a programming language … Alice) Test your design (run your program and evaluate the result … does it work as required?) If the animation is not correct or complete repeat this process appropriately
4
Fall 2009ACS-1805 Ron McFadyen4 Example Read the “First Encounter” scenario: “After traveling through space, … Design From the scenario, determine the problem to be solved: What is the story to be told? What objects are required? What actions are needed? Use the storyboard technique to outline a solution Implementation Create an initial scene Translate the storyboard actions into code Test Determine if the implementation meets the requirements of the scenario
5
Fall 2009ACS-1805 Ron McFadyen5 Creating Your First Animation First Encounter scenario (from text): After traveling through space, a robot-manned craft has just made a breathless landing on the surface of the moon. The robot has already climbed out of the lunar lander and has set up a camera so earthbound scientists in Houston can view this historic event. Through the camera we can see the robot, the lunar Lander and some nearby rock formations. Suddenly an alien peeks out from behind a rock and looks at the robot. The robot is surprised and rotates its head all the way around. The robot walks over to take a closer look and the alien hides behind the rocks. Finally, the robot looks at the camera, signals danger, and says “ Houston, we have a problem?”
6
Fall 2009ACS-1805 Ron McFadyen6 Storyboards When planning a program we can create storyboards to organize our approach. Two forms you might use: Visual hand-sketched screen captures Textual Algorithm Pseudocode
7
Fall 2009ACS-1805 Ron McFadyen7 Storyboards The text’s textual storyboard The above outlines an algorithm – a set of instructions to follow to accomplish a task The above is also referred to as pseudocode – it is very close to program statements Do the following steps in order alien moves up alien says "Slithy toves?" robot's head turns around robot turns to look at alien Do the following together robot moves toward the alien robot legs walk alien moves down, …
8
Fall 2009ACS-1805 Ron McFadyen8 Flowcharting A designer/programmer might use a flowchart to illustrate her/his design start stop Alien moves up Alien says “Slithy toves?” Robot’s head turns around Robot says “Houston…” Robot turns to look at alien A A Robot walks toward alien Alien moves down
9
Fall 2009ACS-1805 Ron McFadyen9 Your First Program Implementing the design Select a world Choose your objects Create an initial scene Edit World.my first method create instructions using objects, methods, … See class demo Note how the animation is developed piece by piece - incrementally Do in order Do together If/Else Loop While For all in order For all together Wait Print // comments
10
Fall 2009ACS-1805 Ron McFadyen10 Your First Program Testing your implementation Play your world Observe the behaviour Is the behaviour what you expected? If yes … then you are done Otherwise … you have a bug and you need to Determine what needs to change Is the scenario correct? Is your design correct? Is your code correct? Make the changes and repeat this whole process again See class demo
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.