Programming in Alice Facilitation Guide
Programming in Alice Facilitation Guide
Programming in Alice
Summary
The facilitator guide is intended to aid the instructor in introducing the use of the Alice Code
Editor for creating a program or script for a story or game. This guide is specifically designed to
help guide the facilitator through the introduction of the Alice built-in procedures. The guide
includes a basic overview of the Code Editor interfaces and some basic code building skills.
This lesson should be one of the early lessons in The Alice Project curriculum. It introduces the
minimum skills necessary to create a program in Alice. Additional lessons will build upon this
lesson and expand upon different aspects of the Alice Code Editor. This lesson teaches students
the basic steps to creating an animation or interactive project. It also includes options for
participants to explore the code editing tools and debrief their learning experience.
It is assumed that this lesson would follow the Building A Scene lesson so students have a basic
understanding of adding, removing, and orienting objects. This lesson can be offered as stand-
alone lesson on basic Alice programming, or students may carry forward to the next lessons,
which expands on other programming concepts and other functionality of the Code Editor. It
may also be used to kick off a longer project-based curriculum, where the program built during
this lesson is later used as a starting point for later lessons.
Learning Objectives
Programming Objectives:
● Define a Computer Program
● Define a Method
● Define a Procedure
● Define a function
● Define Parameter and Argument
● Define a control structure
Alice Objectives:
● Define the Components of an Alice Program
● Code Editor Overview
● Define an Alice Statement
● Add a Procedure to an Alice Program
● Run an Alice Program
● Add a Control Structure
● Edit your Program
● Locate Additional Resources for the Code Editor
Lesson Overview
● Introduction
● Lesson on the Alice Code Editor
● Student Work Session
o OR Step-by-Step Work Session
o OR Guided Student Work Session
● Assessment
● Debrief / Students Share Work
Skills Overview
This project was developed for use with Alice 3. The following Alice 3 skills will be learned
through the lesson and additional resources related to the skills can be accessed in the How To
videos and the tutorial exercise for this lesson. Optional educational activities can be
incorporated based on their relevance to the required steps for the project.
Alice Basics
Navigating the Alice Code Editor
Adding Procedures to an Alice Program
Running an Alice Program
Editing and Modifying Statements
Modifying a Procedure’s Execution
Changing a Procedure’s Position in myFirstMethod
Modifying a Procedure’s Arguments
Using a Procedure on a Subjoint
Copying and Pasting a Procedure
Deleting a Procedure
Control Structures
Incorporating Do in Order and Do Together
Camera Markers
Programming Camera Moves with Camera Markers
Sound
Adding audio
Vocabulary
Argument - A value that is used by the method to perform an action; it tells the computer
program how to implement the procedure.
Camera View - The part of the Code Editor that shows the scene from the starting position;
contains the Setup Scene button and the Run button.
Class - Contains the instructions that define the appearance and movement of an object.
Code Editor - The place where you add the programming instructions to program your
animation.
Control Panel - Contains blocks that you drag into the editor to build your program.
Control Structure - Allows you to change the sequence or logic that controls the order and
timing of statements being run.
Disable Code - This code will be ignored when the program is executed; right click on a
statement to toggle.
Do In Order - A control structure in Alice that will follow the list of statements you provide in
the exact order you see them in your program; similar to a recipe.
Do Together - A control structure in Alice that will enable statements to happen at the same
time.
Gallery - A collection of three-dimensional objects that you can insert into the scene.
Method - A small defined set of code within your program that gives instructions for the
program to do something.
Methods Panel - where you will find code blocks that are dragged into the editor to create
program statements (contains the procedures and functions tab).
Procedure - A set of instructions, or programmed code, for how the object should perform a
task.
Procedural Methods - Directions for how the environment or objects in the environment
should behave, such as "move forward."
Classroom Resources
Computer Access
Each participant should have his or her own computer for the duration of the project. It
is also possible to allow pairs of students to work together at a shared computer.
Presentation + Lecturing
Ideally, you should be able to present the lesson slides in front of the class. Depending
on your approach, you may also want to be able to show Alice and be able to
demonstrate and guide the class through the exercise. You can also print and distribute
these materials if needed.
Supporting Materials
You may want students to have access to the How To videos that accompany this lesson.
This can be achieved by insuring they have access to and can play videos on Alice.org.
You may also wish to download, print, and distribute the accompanying Quick Reference
Guides associated with the How To videos. These materials can be downloaded in .doc
format to combine several into one hand out.
Software Requirements
This lesson requires each computer to have Alice 3 installed and accessible.
Time
The lesson is designed to take 45-90 minutes, depending on:
● The inclusion of the lesson presentation
● Time spent going over skills training
● Time spent on optional learning activities
● Complexity of exercises or projects assigned
● Time spent debriefing
Suggested Process
Introduction
Tell the students that they will be shown how to use built-in procedures to create a simple
program. Describe the class activity and discuss the skills they will acquire in the process.
Option 1:
Run completely through the supplied presentation slides to give an overview of the
Code Editor, the concepts, and the skills. More detailed talking points are provided
below for highlighting key concepts while giving the presentation.
Option 2:
Integrate the “hello, world” exercise to break up the lecture and give the students a
chance to write their first program. This can be introduced immediately following the
directions on how to add a procedure, and before moving on to control structures.
Option 3:
Integrate application demos or the more in depth How To videos into the presentation
at the relevant topic moments. The level of detail and time spent on the skill details may
be determined by how you plan to integrate the exercise component, accessibility of the
supporting materials to the whole class, and the skill level of your students.
Exercise Facilitation
There are several options to allow the participants to explore the Code Editor and apply the
new skills. Here are some options, from open exploration to most guided:
● Play the more general How To videos and then allow participants to
follow the step-by-step directions for the module,
● Or demonstrate the exact steps from the tutorial to the class and then
have them complete the demonstrated steps.
A guided facilitation guide is provided below with more details and supporting talking
points. The session would follow this basic flow:
Assessment (Optional)
You can use the supplied bank of assessment questions, challenges, and exercises to quiz your
students on the retention of their new skills. These materials are provided in a separate
document that can be downloaded from the webpage associated with this guide. A word
document has been provided to allow you to customize as needed.
Class Regroup + Summary
We recommend regrouping as a class to discuss challenges and successes, and to offer
feedback, both among the participants and about the curriculum itself. There are provided
reflection questions found below.
Program statements in Alice have required fields that are called parameters. What are
parameters? What is an argument?
Slide 21 Parameters
● When a procedure is added to the Code Editor, there are a series of sub-menus
that represent parameters for that procedure.
● Different procedures will have different parameters:
○ Move will ask for direction and distance in meters to move.
○ Turn will also ask for direction, but will ask for amount (in
percentage) of the rotation.
● Without having information for these parameters, the program won’t know what
to do.
Program statements in Alice are created by selecting the object that will execute the procedure,
dragging the procedure tile into the editor, and selecting the appropriate arguments for the
procedure.
Slide 25-26 Select the Object and Create a Statement
● The Objects Menu, located underneath the Camera View and above the
Methods Panel, displays all the objects currently available to the programmer.
○ It should be noted that the “this” object listed in the menu refers to the
scene object.
● To add procedures for the subjoints of an object, select the object’s SubJoint
menu, by clicking on the right-arrow triangle in the menu.
● Click on the Procedures tab, if it is not already selected.
○ You will notice that the subjoints have a different set of procedures
available compared to an object.
● Click and drag the selected procedure tile into the editor
● A green line will appear in the editor, indicating where the new statement will
appear.
● When there are already program statements in the editor, it is possible to insert
the new statement before or after those that are already there.
● When a procedure is added to the Code Editor, a series of sub-menus will appear
depending on the arguments required to execute the statement.
○ An argument is information that a statement needs to execute the
instruction.
○ For example, Alice will prompt for the direction and the distance for an
object’s move.
Alice allows you to Run your program as often as you want. This is a great way to test and
iterate your work.
(This is a great place to pause and have the class do the “Hello, World!” exercise
together.)
To create more complex programs you will use elements from the control panel. The two most
common control structures you will use are the Do in Order and the Do Together.
Slide 31 Do In Order
● Do in Order is the default behavior for method tabs in the Code Editor.
● Do in Order treats your statements sequentially.
Once statements have been added to the program in the editor, they may be modified by
changing the statement arguments, moving the statements to different positions in the editor,
deleting/disabling statements.
Slide 35 Undo/Redo
● In the Code Editor there is no Undo / Redo button as there is in the Scene Editor.
● Keyboard commands in the Code Editor
○ Windows: Control+Z, Control+Y
○ Mac OS X: Command+Z, Command+Y
Some simple tips and tricks to remember when you are using the Code Editor.
Slide 42 Notes About Other Alice Procedures
● moveTo:
○ This procedures allows you to move one object to the location of another
object so that both pivot points are at the same place.
○ The objects will look like they are overlapping; Alice does not have built-
in collision detection.
○ The orientation of the moving object does not change.
● orientTo:
○ This procedure does not move the object.
○ The object’s orientation will change to be in alignment with the target’s
orientation.
○ moveAndOrientTo:
■ This procedure moves one object to the location of
another object so that both pivot points are at the same
place.
■ The orientation of the moving object will change to the
same orientation of the target object.
● turnToFace:
○ This procedure turns an object around its pivot point, so that its forward
orientation will be in the direction of the target.
○ This does not change location.
● pointAt:
○ This procedure turns an object around its pivot point, so that its forward
orientation will be in the direction of the target’s pivot point.
○ This does not change the location.
● say / think:
○ This procedure uses TextStrings (sequences of letters and digits) as
arguments to create speech or thought bubbles.
○ Optional detail arguments will allow modification of the speech/thought
bubbles.
○ The programmer cannot modify the placement of the bubbles. Alice
makes its best guess as to where the bubbles will appear.
These step-by-step directions are for the guided facilitation option 3 that uses the Scene Editor
Tutorial as a basis for the hands-on experience for the session. They can be followed in addition
to having first gone through the slides.
Media
● Play the video: Scene Editor Overview
● OR demonstrate selecting and opening a saved world
Talking Points
● Remember that you can use the Scene Editor How To videos to refresh the use of the
Scene Editor
● When placing an object off-stage you can place the object where you want it to end
after it’s movement and use one shots to move it a specified distance and direction that
you can keep track of and then use to program the entrance.
● Remember that if you can’t find an object after placing it that it may be obscured or
inside of another object.
Media
● Play the relevant parts of the Procedures Overview How To video
● OR demonstrate adding a procedure to the Code Editor
Talking Points
● Methods (procedures and functions) are part of the classes that are used in the
animation. Alice objects come with a set of built-in procedures. Other lessons will show
how the programmer can create new procedures and functions for an Alice class.
● The Object Menu, underneath the Camera View in the Code Editor, is the list of all the
objects that are currently in the scene. Select the object that will execute the procedure.
o It should be noted that the object this in the menu refers to the scene object and
is where you will find the atmosphere and fog procedures.
● Make sure that the students have selected the Procedures tab in the Methods Panel.
o You might also check to be sure that the student has selected the
myFirstMethod tab in the Code Editor.
● Drag and drop the selected procedure into the Code Editor. A green line will show
where the procedure statement will be placed. It is possible to insert the procedure
anywhere in the Code Editor.
● Almost every Alice procedure requires information – arguments – to successfully
execute.
o Alice tries not to permit incomplete statements in the code, and therefore drop-
down menus will appear, asking that the information be provided. If values are
not selected from the menus, then the statement will not be added to the Code
Editor.
o For example, a move statement needs to know which direction to move, and the
distance to move. A turn statement needs to know which direction to turn, and
the amount of the rotation.
o Even if you are not sure of the final value to be used, you must select a value,
which can be modified later
Media
● Play the relevant parts of the Procedures Overview How To video
● OR demonstrate the various techniques for modifying and editing procedures in the
Code Editor
Talking Points
● Modify arguments by clicking on the arguments in a program statement. A drop-down
menu will appear that will allow the selection of appropriate argument values, including
changing the object executing the statement.
● The add details button, on almost every procedure, provides a menu of additional
arguments for the program statement. The most common additional arguments are:
o Duration: Determining how long it will take the animation to execute. By default,
all Alice animations will execute in one second.
o Animation Style: Determines how an animation will start and stop when it
executes.
o As Seen By: Determines the point of view (or orientation) that will be used by the
object when it executes.
● Inserting/repositioning statements in the editor
o A green line indicates where in the editor the procedure tile will be placed when
dragged from the methods panel.
o It is also possible to move a statement that is already in the editor to another
position in the program code by clicking and dragging the tile into a new
position, also indicated by the green line.
● Deleting statements from the editor
o A statement may be deleted from the program code in the editor by clicking and
dragging it back to the methods panel. A Trash Can icon will appear in the
Methods Panel to indicate that the statement will be deleted.
o It is also possible to right-click on the statement tile, in the editor, and from the
context menu that appears, select delete, which will remove the tile.
Media
● Play the How To video: Using a Do Together
● OR demonstrate setting up a do together
Talking Points
● The Control Panel, located at the bottom of the editor, displays all the control structures
available in Alice.
● To add control structures to the editor, drag them into the editor. You can then add or
drag existing statements into the block to build.
● You can add additional control structures inside of other control structures.
Media
● Play the How To video: Setting Up and Using Camera Markers
● OR demonstrate setting up a camera marker and creating a camera move procedure
Talking Points
● You can animate the camera the same way you can animate any other object in Alice.
● You can also use unique camera markers to help program camera moves.
● Camera markers are set up in the Scene Editor and have both a location and an
orientation.
● You can use camera markers to move and orient the camera object by using them as a
target for camera procedures.
● You can add additional control structures inside of other control structures.
Reflection Questions
● How does your experience with this lesson align with your previous idea of what
programming is?