Agenda 9/9

 

Review:

 

Notes on homework process:

  • Must submit when ready
  • Bulletin for me to follow the sharing process.
  • Did you like this way of doing a group project? Did you learn? Can you be tested now on what you learned? Did it enable shirking or help with motivation and hard parts?
  • (next week Part of homework – email me subject – csc160 group  or QA– how did the group project work for you?)
  • have them download and look at one other person's world

 

Learning objectives of last week:

  • Enough familiarity with Alice to use it
  • project process – design, code, test (project management)
  • line by line flow – the way a program thinks
  • Ability to use of methods and know when to use them
    • Types – world, object
    • Reasons to use:
      • Break into smaller parts
      • Teach behavior
        • more sense if 2 or more lines
        • teach the right object
          • why is it not a great idea to make the rabbit hop a method of the flower – try exporting
          • why is it not a great idea to make the rabbit hop a method of the world – export rabbit
      • Reuse your work
        • Bunny hop, slide, hop and then dancer moves to bunny and spins and then bunny hops again – what methods would you create

Coming objectives:

  • Use functions
  • Variables for methods
    • Variable types  and setting and using variables
  • Parameters
  • Property variables
  • Create functions
  • Extra
    • Asking user for input
    • vehicle

 

Movement and camera: - not so important

  • Attributes that change: position, orientation
    • Get up and turn to effect your yaw
    • Make your character turn right and left
    • Make your character's arm turn right and left
  • Get up and change your pitch
    • Repeat for character and his left arm
  • Get up and change your arm roll
    • Repeat for character and his right leg
  • Camera
    • Move camera and drop dummy
    • Move camera and drop dummy again
    • Put set point of view 2 times in your movie
    • play

           

Practice Review:

  • One scene with bunny and dancer
    • Bunny hop method 
    • Slide
    • Bunny hop
    • Then dancer move to bunny
    • Dancer slides
    • Then dancer spins
    • Then bunny hops again
  • Make bunny hop up over down
  • Add a comment

Use a function

  • make bunny hop up as far as dancer
  • See how amount changes?

String:

  • Make bunny say how far to hop (use world / what / to string)

 

Method variable:

  • Make bunny hop better with up / over / down
  • Create a variable to store how far so I can work with it
    • Naming – lower case
    • Show box
    • Mention type
    • Local – only the method knows about it – the world has no clue
  • Set the value initially
  • Use the variable
  • Reset the value in code
    • ½ up / over
    • Ask function how high
    • Ask user how high (world function drag over variable set)

Parameter

  • Want to give control outside the method
  • Pass it length for hop
  • Other types
  • Pass it something for the bunny to say

 

Probably skip - To show use of parameters without any other variable:

§         Spin dancer with right arm in air

    • Roll right arm left .25
    • Roll right upper arm left .8
    • Roll right leg right .6
    • Turn right body

§         Spin

§         Hop

§         Spin

 

§         Want second spin on left arm

    • Great to tell it which one
    • A box to hold choice and method can look at choice

 

Create a new functions and use it:

  • to ask the user their first name and last name and return the full name. 
  • remember a+b function

 

Homework:

 

Switch roles: Write a story (or continue last story) including:

  • 2 scenes
  • 2 characters each with
    • 1 method (something it does – no return) that uses a variable
    • 1 function (something it does – with a return)
      • Example:
        • to ask the user their first name and last name and return the full name.  
        • to add 50 to a number (parameter in) and then divide that result by 2
        • to zoom into another object (that other object is a parameter) and return the distance to it minus 1.
    • Either the method or the function needs to use a parameter.