APS - Motion and Decision Basics (Lesson)

Motion and Decision Basics

Movement with Alice

When we worked with Alice previously, we put the objects in the scene and had them speak. We covered a little of the basics and a brief glance at the blocky programming language.  

First let's look at movement with Alice. Watch the video below to learn some basic motion procedures for motion and orientation of objects in Alice. After the video, practice the use of the concepts you learned and others that may be similar. Remember, computer science means having the willingness to examine new concepts to create new ways to use the information. Computer science means trying what comes along.

Building a Project

Now that you have some of the basics of orientation and movement, it is time to follow along and actually build a project.    

First a brief explanation of a few vocabulary terms: 

Alice Vocabulary Terms
Alice word or phrase

Explanation

compare

use of operators <, <=, =, >, >= and others;

a part of making decisions is deciding what problem has to be compared to allow for a decision

do in order

statement at the beginning of the myFirstMethod screen; tells the program that you are creating to do each of the following steps in the sequence that you have written them; found at the bottom of the myFirstMethod screen if an additional ordering is needed

do together

indicates that all of the statements in the body of the statement will be done at the same time; found at the bottom of the myFirstMethod screen

decision

a choice to be made,   example if   else

function

an algorithm that provides an answer

if else

if (condition true) do this else do this;

found at the bottom of the code editor

orientation

an objects forward motion is always the way the object is facing;   other directions are relative to this

procedure

an action on an object; a method that the object can do

use snap

on the scene setup, top right;   allows the placement of objects at the same depth or varying depths in the scene

In creating some of our earlier algorithms, we made if else choices. Here is the basic code for an if else decision:

if (condition) is true

                do the following statement or statements

else

                do this statement or statements

The indentation tell us that the statements after the true condition or the false condition all are done together.  

For example:

if today is a school day

                I get up at 6 am

                Get dressed

                    Go to school by 7 am

else

                I sleep late

                Get dressed

                Play a computer code game

The indentation allows us to know what code goes with the true statement and the false portion of the statement.  Detailed information will be found in the next module.  For now, follow along in the Learning Assignment, learning by doing.

In the following tutorial videos follow along and create your comparison of two different objects from those in the video for practice. Practicing yourself is what will help you learn the Alice world.  

Practicing is an integral part of learning to code. Coding is a new language that allows creativity and freedom to experiment and find your way. Because we are learning, learning is part of the overall project grade in this module. The project will be due progressively with time to reflect and learn between each part.  

Note that testing of the program continues throughout the process of coding so that adjustments and corrections may be made when the reason for the code is still fresh in our mind. This allows for proper adjustment in a timely manner. Large chunks of code left to test at the end could have compounded errors because one error may later cause another issue.

Rule of thumb - test frequently!

VIDEO SOURCED FROM ALICE.ORG AND USED ACCORDING TO TERMS OF USE.