Textbook Notes (362,842)
United States (204,245)
Chapter 1-4

Chapter 1-4 Alice In Action Notes.docx

6 Pages
Unlock Document

Boston University
Computer Science
CAS CS 101
Aaron Stevens

Chapter 1 Alice Notes Flow - a series of steps that precisely specify (in order) the behavior of each object in the story • in programming, known as an algorithm (a sequence of steps that solve a problem) Object Tree - where the objects in your world are listed (main programming occurs here) • contains several objects: ◦ Camera - can be moved within the world, its position determines the world window, changes the position and orientation ◦ Light - can be moved, but rarely | can change the position, orientation, color, brightness ◦ Ground - doesn’t make sense to move it but has options (snow, grass, dirt, etc.) Details Area - includes properties, methods, and functions panes • properties pane: lists properties, or changeable attributes of an object ◦ includes color, opacity, vehicle, skin texture, fill style, point of view, and visibility • methods pane: lists the messages we can send that object to animate it • functions pane: lists the messages we can send the object to get information from it ◦ includes: proximity, size, spatial relation, point of view, subparts Editing Area - where we edit or build the program that controls the animation, contains “world.myfirstmethod” (starts empty, or without statements) Events Area - where we can tell Alice what to do when special actions (events) occur • clicking “Play” will run through the “my first method” which is made up of any statements within it doInOrder - a structure within which we can place program statements and will perform them in the order they appear, top to bottom methods - behavior-producing messages target - the things that which we want an object to point at, move toward, etc. doTogether - a structure within which we can place program statements to perform them simultaneously Chapter 2 Alice Notes Creating your own methods (under “world"): • to divide your story into manageable pieces to help keep it more organized • to provide an object with a behavior it should have, but does not • NOTE: methods should start with lowercase letters and should NOT have spaces • Send all the new scenes the “world.myfirstmethod” in order for Alice to play them TIP: if you need to use the scroll bar to view all the statements in a “scenes” method, it’s good to break scenes down to separate shots • edit each shot individually, then order them under their specific scene, and ultimately put the “play scene” in the “world.myfirstmethod” Object Methods • Used to define a complex behavior for a single object • NOTE: in the editing area, you can use “//“ to place your own personal comments in between statements so that you can understand what they do Reusing your work • Drag your work to the clipboard in the top right corner in order to copy and paste it to a different world method or use later • to use in a different world: ◦ right click object, choose “save object…”, and pick a place to save it, then “File” —> “import” Dummies - an invisible marker in your world that has a position and an orientation • Manually move the camera until it is in the position and orientation where you want it for a given shot • Drop a dummy at this specific camera position to gain the camera’s point of view • Rename the dummy something descriptive • At the beginning of the method for this shot, send the camera the setPointOfView() message with the dummy as its target 3D Thinking • Every object has the 2 following properties 1. an object’s position determines its location within the 3D world 2. an object’s orientation determines the way it is facing in the 3D world, determining what is in front and behind, left and right, and above and below the object • Every object has 3 axes 1. backward & forward 2. right & left 3. Up & down • we can use the axes to determine an object’s exact location, these make up an object’s position 1. Left-Right determines width (LR axis) 2. Up-Down determines height (UD axis) 3. Forward-Backward determines depth (FB axis) • The “Move” method contains these three axes • Orientation 1. Yaw: causes an object’s rotation on the same axis, rotates on the UD axis (turn object left and right) (ex. shaking head no) 2. Pitch: cause an object to “dive” up or down, rotates on the LR axis (ex. a plane pointing up or down) (ex. shaking head yes) 3. Roll: cause an object to “roll” left or right, sort of like banking a turn, uses the FB axis Chapter 3 Alice Notes Variable - a name that refers to a piece of the program’s memory, in which a value can be stored, retrieved and changed • makes it easier to define methods • Method Variable - lets us store a value within a method for later use 1 “local variables” because they can only be accessed from within the method they are defining • Parameter - type of variable that lets us write methods that are more broadly useful • Object Variable - lets us store a property of an object 1 Store information to find the exact distance, time, etc. for something instead of using trial-and-error 2 Use a noun for the name of a variable that describes the value it stores Types - describes the kind of value we intend to store • Number - numeric values • Boolean - logical (true or false) values
More Less

Related notes for CAS CS 101

Log In


Don't have an account?

Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.