Using Functions in Alice

Similar documents
Step 1: Changing the Penguins Colors. Download the starting world that goes with this tutorial. We are

Coloring Randomly: Random Selec2on in Alice. By Jenna Hayes under the direc2on of Professor Susan Rodger Duke University July 2008

The Essentials of Alice (Bunny) By Jenna Hayes under the direction of Professor Susan Rodger Duke University July 2008

The Essentials of Alice

Changing Camera Views! Part 2: Simple Scene Change & Lighting Fixes

INTRODUCTION TO WEB RESOURCES Part 2: Access to local campaign web pages

CompSci 94 Making Decisions February 8, Prof. Susan Rodger

Hey guys, With that, let s begin. HOW TO INSTALL OFFICE 2013 ON THE WINDOWS RELEASE PREVIEW. Step 1: Create an account and join the preview

By Ruthie Tucker Under the direction of Professor Susan.

Repetition everywhere comparing while in a method and as an event. Comparison

using Arrays and Lists in an Alice world Prerequisites Everything World.OpeningScene Cinderella.end the chickens while they dance.

Nonvisual Arrays and Recursion. by Chris Brown under Prof. Susan Rodger Duke University June 2012

Animating Objects in Groups: Using Arrays and Lists

Animating Objects in Groups: Using Arrays and Lists. By Ruthie Tucker under the direction of Professor Susan Rodger Summer 2008

Your message in Outlook will look something like the illustration below. Begin by right-clicking on the name of the attachment.

Plotting Points. By Francine Wolfe Professor Susan Rodger Duke University June 2010

Alice: A Free 3D Animation World for Teaching Programming

Methods Tutorial: Part Two. By Deborah Nelson Duke University Professor Susan Rodger June 16, 2008

Learning to Program: Part 1 Scene Setup and Star4ng Anima4on

You are going to code your micro:bit to read the future! Simply ask the micro:bit a quesition, and press a button to find out the answer!

Intramural Game Mode Tutorial

Class-level Methods. Chapter 6 part 1

How to use your Participant Center for fundraising success! How to: Login

Trash in the Dock. May 21, 2017, Beginners SIG The Dock (Part 3 of 3)

The smarter, faster guide to Microsoft Outlook

Shorter of two objects and changing color V2

UDK Basics Textures and Material Setup

Barchard Introduction to SPSS Marks

Inserting or deleting a worksheet

Sample A2J Guided Interview & HotDocs Template Exercise

Getting Started with Java Using Alice. 1 Copyright 2013, Oracle and/or its affiliates. All rights reserved.

Barchard Introduction to SPSS Marks

Caustics - Mental Ray

TI-83+ Z80 ASM for the Absolute Beginner

Spectroscopic Analysis: Peak Detector

Creating a Fancier Fox and Inheritance in Alice 3

SCRIPT REFERENCE. UBot Studio Version 4. The UI Commands

Kermit 95 SSH Installation Instructions

The Whyline. An Interrogative Debugging Interface for Asking Questions About Program Behavior. Andrew J. Ko and Brad A. Myers

Princess & Dragon Part 1: Objects in an Alice World

You are going to learn how to make a timer, so that you can use it to challenge your friends!

Welcome to Sinclair Wilson Movie Making!

BONE CONTROLLER ASSET VERSION 0.1 REV 1

Valuable points from Lesson 6 Adobe Flash CS5 Professional Classroom in a Book

We aren t getting enough orders on our Web site, storms the CEO.

How to perform a custom RAID configuration in DS for Dell 2.0

OpenCanvas 1.1 Networking Tutorial

Club Leader Access to 4-H Online

Magic Set Editor 2 Template Creation Tutorial

How to git with proper etiquette

Decision Structures. Chapter 4

Document Formatting with Word

Java CAPS Creating a Simple Web Service from a JCD

Making Objects Move in Unison: Using Lists. Overview

Making Objects Move in Unison: Using Lists

Get comfortable using computers

CSS worksheet. JMC 105 Drake University

Need Help? Page 1 of 36 WORK

Joshua Hodgskin Unit 11 task 3

QUICK EXCEL TUTORIAL. The Very Basics

BE A MOVIE MAKER! Before we import our pictures, we want to change the default frame rate -- in other words, how fast our movie will run.

Valuable points from Lesson 8 Adobe Flash CS5 Professional Classroom in a Book

Customizing DAZ Studio

Tap to enter a search item or web address. Open a new tab. Your open tabs. See pages open on other devices.

How To. Create a Free Autoresponder Using

Instructions for Editing in the new System DNN9 the Upgrade from DNN8

Adding Pages. Adding pages to your website is simple and powerful! In just a few minutes you can create a page that: Highlights a special event

CSCU9B2 Practical 1: Introduction to HTML 5

SharpSchool Website Training Guide

Creating and Attaching Custom Question Surveys 10 Step Tutorial

Interactive Tourist Map

NCMail: Microsoft Outlook User s Guide

Workshop BOND UNIVERSITY Bachelor of Interactive Multimedia and Design Beginner Game Dev Character Control Building a character animation controller.

ArcMap Online Tutorial Sarah Pierce How to map in ArcMap Online using the Fresh Prince of Bel Air as an example

Game keystrokes or Calculates how fast and moves a cartoon Joystick movements how far to move a cartoon figure on screen figure on screen

Embedding Google Docs in Blackboard Interactive Table of Contents

Table of Contents. yright 2012

Popcorn's ini Tutorial

SCRATCH MODULE 3: NUMBER CONVERSIONS

Piktochart 101 Create your first infographic in 15 minutes

Using Dreamweaver CS6

The requirements according to Autodesk are to be using Xcode with the 10.8 SDK(comes with it). Xcode 6 does not have this SDK.

Microsoft Word. Unit B Editing Documents Mr. Lewis

ASCII Art. Introduction: Python

How to Make Your RooFolio

Student Exploration: Quadratics in Polynomial Form

Shorter of two objects and changing color


Copyright 2004, Mighty Computer Services

How do I show custom color swatches?

HDR/MDR Software Installation Detailed Instructions

Installing Komplete 5 with Direct Install

Introduction to SPSS

Setting Up the Fotosizer Software

How to Make a Book Interior File

This lesson will focus on the Bouncing Ball exercise. Feel free to start from scratch or open one of the accompanying demo files.

Sims 3 Custom Paintings with EA Meshes

You can now give this notecard to people by dragging and dropping it on their avatars.

My First iphone App. 1. Tutorial Overview

Dice in Google SketchUp

Transcription:

Using Functions in Alice

Step 1: Understanding Functions 1. Download the starting world that goes along with this tutorial. We will be using functions. A function in Alice is basically a question about information in your Alice world that Alice answers. Click on the penguin object in the object tree. Then click on the functions tab. You will see a LONG list of functions. Scroll down and look at the functions under size. 2. These functions can be very useful in Alice. What if, for example, you want to make something move up and stand on top of the penguin s head? You don t know how exactly how tall the penguin is. But Alice does!

Step 2: Using the True or False Functions We are going to add commands so that when the Alice world starts, if the penguin is taller, it will say Hah! I m taller!, but if the normalguy is taller, he will say, Hah! I m taller!. Some functions in Alice are statements to which the answer is either true or false, like the one on the previous page that says, penguin is taller than. We want to know whether the penguin is taller than the normalguy. It s almost impossible to tell just by looking at them, because their heights are so close together. So we will use a function to know for sure.

Step 2: cont. Since we only want the penguin to say Hah! I m taller IF he is taller, we need to use something called an If Else statement. It is located below your method editor: First drag a Do in order into your method editor. Then, inside that, drag in an If Else statement.

normalguy. person person

Step 2: cont. So let s construct our command. Click on penguin in the object tree and then click on functions. Find the penguin is taller than function, and drag it over the word true in your If Else statement. When the little menu pops up, click on normalguy. Your code will look like this:

Step 2: cont. Now click on penguin in the object tree, and then click on methods. Find penguin say, and drag it into the method editor under If. When the menu pops up, click on other, and type in Hah! I m taller!. Your code will look like this:

Step 2: Now click on normalguy in the object tree, and click on methods. Find normalguy say and put under the Else part of your If Else statement. Tell him to say Hah! I m taller! Your code will look like this: Now play your world. Who is taller, the penguin or the person?

Step 3: Using Number Functions Now we re going to use one of the functions that is a question whose answer is a number. We re going to make the penguin move right up to the man and give him a hug. The only problem is, we don t know how far to tell him to move! That s why we ll use a function! First we ll tell the man to say something. He s tired of competing with the penguin about their height, and he wants to be friends. Click on normalguy in the object tree, then click on methods. Find normalguy say, and drag it under your If Else statement. Make him say Let s be friends. Give me a hug, penguin! Your code will look like this:

Step 3: cont. Now we want the penguin to move right up to the guy to hug him. Click on penguin in your object tree and then click on methods. Find the penguin move and drag it into your method editor under everything else. We don t know exactly how far yet, so just put 1 meter for now. Your code will look like this: Play your world just to see what it looks like.

Step 3: cont. Now we re going to use a function to tell the penguin how far forward to move. Click on penguin in your object tree, and then click on the functions tab. Find the function called distance in front of. Drag that function over the 1 meter on your penguin move forward command and drop it there. On the menu that pops up, select normalguy. Your code will look like this:

Step 4: Finishing Up The last thing you need to do is make the penguin hug the guy. Click on penguin in the object tree, and then click on the methods tab. Find the hug method and drag it into your method editor under everything else. Your final code will look like this: Now play your world and watch the magic!

Now you know the basic of using functions. We only used two functions in this tutorial, but there are MANY functions in the Alice world that can be useful. Feel free to explore the uses of other functions.