Object-Oriented Programming

Alice & Storytelling Alice Thoughts & Resources

I had a lot of fun working with Storytelling Alice for my Programming for Beginners class. In fact, I think I would like to do a workshop entirely on working with Alice (or Storytelling Alice) next time.

What is Alice?

Alice (& Storytelling Alice for that matter) allows you to create and program 3D worlds. It was developed at Carnegie Mellon University under the direction/leadership of Randy Pausch (NOTE: you absolutely must watch Randy Pausch Last Lecture: Achieving Your Childhood Dreams or read The Last Lecture if you haven’t before–I dare you to watch or read it all the way through without shedding a tear).

With Alice…

  • You can program animations
  • You can program 3D games
  • You can program simulations
  • With your imagination, I’m sure you can do other things I did not think of
  • And Most Importantly, while you’re programming games and animations, you’ll be learning to program the following…

    • variables (local & global)
    • conditional execution
    • repetition (while loops & for loops)
    • math
    • event-driven programming
    • object-oriented programming (methods, properties)
    • and you might not even realize it

There are currently 3 Main Versions/Flavors of Alice:

  1. Alice 2.2 (or Alice 2.0) – Good for high school and college
  2. Storytelling Alice – Good for middle school or high school (really, in my opinion)
  3. Alice 3 (Beta) – You need Java for this, for this reason, it’s better used at the college level. Note the beta; it’s still buggy from my understanding. Highlights are that EA has entered into a partnership with Alice and have provided the Sims characters as 3D models in Alice 3.

Alice or Storytelling Alice?

Some may ask which program is the better program to use. I am no expert on the differences between the two, but from my experience, I have noted the following:

  • All versions of Alice are free (yay!)
  • Storytelling Alice is based on Alice
  • Storytelling Alice works the same way as standard Alice
    • Anything you can do in Alice, you can do in Storytelling Alice (and vice versa)
    • Worlds created with Storytelling Alice will NOT work with regular Alice (not compatible)
  • Storytelling Alice has more methods built into each object – This is very important to note as some students can get frustrated getting over the learning curve of programming objects
    • For example, the horse in Storytelling Alice has the following Methods ready to go (out of the box):
      • shake head
      • charge forward
      • run (distance)
      • rear
      • paw ground
      • walk (distance, speed)
    • In standard Alice, if you want to program a horse walking, you would have to create your own method and individually program each leg (top & bottom parts) to move, and you would have to figure out how to make it look realistic
    • Another example is the “lunch lady” can perform mind control on other characters (you’ll have to download it and try it out yoursel)
  • Storytelling Alice has worlds & objects designed to encourage story-telling – this is probably due to the additional methods

Old Possum’s Practical Post on OOP (Object Oriented Programming)

Let’s talk about OOP, and we’ll use cats as our example:

Classes – we skipped this since the objects were built-in, but just know you can write classes to represent other objects. If you recalled biology, you learned about classification. You probably learned that cats (aka felines) are members of the animal kingdom. When we talk about a cat in general, we are referring to the cat class

Objects – objects are things (how’s that for a recovering English teacher?). Objects are specific things. Take Fluffy the cat for instance (Get it? For instance?). Fluffy is a cat, a particular cat. Any “thing” can be described in two ways: it’s traits or attributes (aka properties), and it’s actions (called methods in OOP)

Note: another term I did not introduce, but is almost always introduced with objects, is instances (remember ‘take Fluffy for instance’?). The word instance is pretty much interchangeable with objects. If you want to split hairs, you would use objects as a general term, and instance when you are specifically mentioning an object in particular. To carry the cat analogy even further, you might refer to all the cats running around your neighborhood as cat objects, and when you want to specifically refer to Fluffy, you would refer to her as the Fluffy instance.

Attributes or Properties – are variables associated with an object. Any given cat will all have the same general properties (all have fur, all have (or at least started out with) claws, all have legs). Please note:

  • Properties can have different values among different cats. Fluffy’s fur might be orange, and Morrisey’s fur might be black. The same thing goes for software objects.
  • Methods – are the behaviors of objects. For example, Fluffy, like all cats, meow, eat, like to chase things, etc. In OOP, objects have methods associated with them so that they can interact with other objects or the user.