PAT - Basic Arithmetic Expression Calculations (Lesson)

Basic Arithmetic Expression Calculations

Distance between objects is measured between the pivot points of the objects. When an object is moved to another object, both objects are at the same location, one on top of the other. To avoid doing this, back off the distance that is returned just a little. Building arithmetic expressions in the addDetail areas is how to do this.

Watch the video below to learn how to use the basic Arithmetic Expression Calculations.

Did you notice the math random function in the video? The random function has the computer generate a number to return based on parameters given.

Basic ARthmetic menu

The above random relationship moves the dolphin right an amount between 0 and 1 in the real number, in other words, using a decimal number. If you used this random number generator, numbers could be created that are greater than one by multiplying by 10.

In Alice, anytime that you are using a procedure, function, or property, how the method works has been abstracted for you. All you need to know is that the method will run its instructions based on the information and detail that you provide.

Adding detail using the drop down arrows, adds parameters, special instructions to the method that are available to allow the customization of your video. A small movement is best to start with in order to see what the movement will do.

Functions of this teen person are shown below. Notice the difference in terminology. Remember, functions are methods in Alice that ask questions and want an answer. Look at the multitude of functions available and these are not all. If the function area contains getLeftHip, then the left hip is able to be manipulated by the programmer by combining different functions into a procedure that can be called whenever needed or in an iterative fashion to create the sense of movement.   

Basic Arithmetic Example

Adding a Parameter

Get verbs here are requesting access to the item in question. Set verbs (not shown here) are changing a value, for instance setName would set the object name to a new name.

Properties

Most of the created properties are found in the scene. Remember they work and are written for you.

Basic ARthmetic Properties

IMAGE CREATED BY GAVS VIDEOS SOURCED FROM ALICE.ORG Links to an external site.  AND USED ACCORDING TO TERMS OF USE.