using procedures practices- oracle

Upload: rudiawan

Post on 14-Apr-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/30/2019 Using Procedures Practices- Oracle

    1/3

    Section 2 Lesson 3: Using Procedures

    Objectives

    Toggle and describe the visual difference between the scene editor and code editor

    Correlate storyboard statements with program execution tasks

    Identify the correct procedure to move an object

    Use procedures to move objects

    Add J ava programming procedures to the code editor

    Demonstrate how procedure values can be altered

    Add a control statement to the code editor

    Use random numbers to randomize motion

    Vocabulary

    Directions: Identify the vocabulary word for each definition below.

    1. An object's sense of direction.

    2. Program code executed once to define a single movement for anobject in a scene.

    3. Tells Alice 3 how to implement the instructions in a program.

    4. A list of instructions that are required to accomplish a task.

    5. A piece of program code that defines how the object shouldexecute a task.

    6. Sequence of numbers generated by a computer with no patternin their sequence.

    7. Describes how to perform the procedure.

    8. Tell the objects in the animation how to perform tasks.

    Try It/Solve It

    1. In your journal, create an entry titled Scene Editor vs. Code Editor. Then, write aparagraph that describes three differences between the scene editor and code editor.Then, list the features of each.

    2. In your journal, create an entry titled Features of Code Editor. List the features thatyou have learned about thus far, and what each does. List three features you have not

  • 7/30/2019 Using Procedures Practices- Oracle

    2/3

    used yet.

    3. Plan an animation for the following scenario using a top-down development approach:A stuffed tiger lays on the ground in the park. A girl walks up to the tiger, pauses for amoment, and picks up the tiger. Then she says, This is the tiger that I lost! Thestoryboard should have two columns: one for the actions in the storyboard, and one forthe procedures and control statements that would need to be written for each action in

    the animation.

    4. Plan an animation for the following scenario using a top-down development approach:Two people have a conversation about the weather. The first person turns to thesecond person and says Nice weather today! The second person says Yes, but Ithink it is going to rain tomorrow. The storyboard should have two columns: one for theactions in the storyboard, and one for the procedures and control statements thatwould need to be written for each action in the animation.

    5. Create an animation with the correct procedures, directions, and distances based onthe following scenario: A camel starts at the back left corner of the scene (the viewer'sleft), walks towards the camera 3 meters, then walks towards a rock 2 meters, stops

    for 2 seconds, then turns to the left 0.5 meters and walks forward 10 meters. Ensurethat the animation works as intended at run-time, and debug if necessary.

    6. Create an animation with the correct procedures, directions, and distances based onthe following scenario: A ship starts at the back left corner of the scene (viewer's left),moves toward the camera 5 meters, then turns 1 meter to the right whilesimultaneously moving forward 10 meters. Ensure that the animation works asintended at run-time, and debug if necessary.

    7. Add an object to a scene. Use a procedure to position the object so that it is 8 metersright, 1 meter above, and 15 meters in front of the center of the virtual world.

    8. Add a tortoise and a hare to a scene in the grass template. Using the drag and drop

    method and handle styles, do the following:

    Drag and drop the objects so that the tortoise is to the left of the hare.

    Move the hare so it faces the back of the scene.

    Resize the tortoise so it is two times larger than the hare.

    Make the hare appear to lie down on the grass.

    9. Create an animation for the following scenario: Five playing cards simultaneouslymove, turn, and roll in order. Create a new procedure for this motion. Run theanimation, then alter the distance and duration argument values in the procedure andrun the animation again to see how the playing card's movements change.

    10.Create an animation that uses the roll procedure to make three penguins appear to rollfrom the back to the front of the scene simultaneously. Hint: The penguins must bepositioned on their side in the scene editor to achieve this motion. Once you make allthree penguins roll, change the number of rolls to a random number between 1 and 5.

    11.Create an animation for the following scenario: P lace a teacup on top of a tea plate(MyProps class folder). Have the tea cup and tea plate turn simultaneously in oppositedirections. Run the animation. In your journal, describe how the objects behave whenyou run the animation.

  • 7/30/2019 Using Procedures Practices- Oracle

    3/3

    12.With a classmate, conduct a peer review of your animation's code for one of yourcompleted animations. Discuss what procedures and arguments you used, and whatworked and didn't work. In your journal, write one thing you learned from reviewingyour classmate's code.

    13.In your journal, create an entry entitled Move Procedures. Create a table that lists 5different procedures and describes how each procedure makes objects move.

    14.In an animation scene, use five procedures that you have not yet used before. In yourjournal, create an entry entitled New Procedures. List the procedures you used, anddescribe how each instructed the objects to move.