Program Design with Alice: Part III

Overview

In today's project we are going to be continue using the Alice software.

The project

You completed the tutorials and became acquainted with the workings of the Alice 3D animations. You explored writing simple methods/actions to increase the capabilities of the objects in your animations. You learned how to add "Events" to your world allowing user interactions with the objects on the screen. In this project, we will take one of the existing projectsand provide an otherwise sad story with a happy ending. Unlike the tutorials, I will not guide your every action, nor will I provide the instant feedback on whether or not to you made an error. This is now your job. I will attempt to give you detailed instructions on what needs to be done and I will suggest what manipulations you should be doing with Alice.

The story line

Open up the snowLove project that is available when you chose File/Open World and then find and select "snowLove" underneath the Examples tab. Play the animation. Watch the sad story of a snow man who see the snow woman of his dreams melt away before his eyes. At Fordham, we believe in happy endings, and so we will fix the end of the story by reviving the melted snow woman and allowing them to proclaim their love for one another. To do this, you will need to create a new method that restores the snow woman, and then add new steps to the story line.

Some Important Notes Regarding Saving Your Work

At any time you can save the world you are working on so you can go back to it later. From your own computer experience, you probably know that it's a good idea save your work fairly often, just in case something goes wrong.

Since you will be making a couple of worlds, it would be a good idea to devote a specific folder in your home directory to hold them. To do this, you should double-click the erdos students icon that's on your Windows Desktop, find your own home directory, double-click same, and then create a new folder; alice is a good name for this new folder.

Now, when you want to save your work, select File/Save As from the Alice menu bar, and then browse to your alice directory, as you normally would when you want to save something. Later on, if you want to continue working this Alice world, you can open it up with File/Open World.

Note: You might find that saving an Alice world directly into your home directory is glacially slow. Should this be the case, try the following workaround:

  1. Save your work on the Windows Desktop.
  2. When you're done for the day, move the file containing your Alice world from the Windows Desktop into your home directory.

We do not recommend that you permanently store your worlds on the Windows Desktop when using the lab machines. Since this Desktop is shared by all students using your particular lab machine, it might wind up being accidentally used by another student; moreover, somebody could easily delete it. If you find yourself using the Desktop to store your worlds, don't panic. When you're done for the day, simply move the worlds that you've saved to your own alice folder.

Working at Home and in the Lab

Should you decide that you want to work on Alice projects at home and in the lab, you'll need to transfer the worlds that you create back and forth. You can do this by emailing the world to yourself as an attachment. Alternatively, you can store the file on a USB drive, which you can shuttle back and forth between home and school.

Getting Started

To get started you need to survey what you already have. On the screen should be the current World.movie. This is what occurs whenever you play the animation. Look at each step and get a sense of what is happening. Many of the steps actually hand the work off to other methods that are part of the world such as World.heyBaby and World.melt. You can look at these methods to see how they work by clicking on the World in the upper left hand corner, and then clicking edit next to any of its methods listed on the lower left which you want to see. Click the edit button next to the melt method and see how they accomplished the melting process. Later on you will be reversing this process so it will be useful to see how it was done the first time.

Task 1

Now that you have a sense of what is going on, you are going to create another melt method. This is mostly for practice, but the experience you gain will help you with the next part of the project.

  1. Click on the World (if you have not already done so).

  2. On the bottom left, select Create Method, so that you can build anothermeltmethod. Call this one meltMan.

  3. Add steps to the meltMan method so it does the same things to the Snowman that are done to the Snowwoman in themeltmethod. Note that to get the Snowman methods to draw over you will need to click on the Snowman in the top left corner and then select the methods you need from the lower left. Also the ability to change the opacity will be found under the properties of the specific body part you want to change.

    Note: There are two ways of approaching this part of the project:

    1. You can click back and forth between the melt method (that was provided for the SnowWoman) and the melt method (that you're writing for the SnowMan) to see what you need to add. This gets to be somewhat annoying after a while.
    2. I have thoughtfully provided a copy of the melt method, as a PDF file. Print this out and refer to it as you're writing the melt method.
  4. When you have completed the method go back into the World.movie tab.

  5. Add the meltMan method to the story right before the fadeOut step of the movie.

Make sure you run the animation at least once to make sure that it works correctly. If the Snowman does notmeltafter the Snowwoman then you have done something wrong and need to check through all the steps again to find your error.

Task 2

Congrats on getting through the first method. However, we really don't want the Snowman to melt so go ahead and remove that line from the World.movie story line. You should be able to right click next to that line in World.movie and select delete.

Now you want to make it so the Snowwoman can be revived.

  1. In the World method create a new method, which you should call unmelt.

  2. Add steps to reverse the melting proceed of the Snowwoman—you should compare your method frequently with the melt method—to make sure you are doing all the steps that affect the Snowwoman in reverse order.

  3. When the method is complete go to the World.movie story and add the unmelt action right before the fadeOut line.

  4. Run the animation.

  5. It is likely that the resizing didn't work quite right. You will need to try some trial and error to get the values of the resizing where you want them to be. The same may be true of the placement of the hat. Just play around with these values until you are happy with the outcome.

Task 3

The hard part is over: the Snowwoman is restored. Now we would like to make the story a little more interesting. Edit the main method of the world, so that it contains each of the following embellishments:

  1. Just after the unmelting begins, have the Snowman raise his eyebrows.

  2. A little farther along in the unmelting have the Snowman spin around in a circle.

  3. As the method ends, have the Snowman jump up and down.

Test your method each time you make a major change to ensure it is doing what you expect.

Task 4

The final touch is to make the two snowmen exchange pleasantries.

Test you story repeatedly to make sure everything works as it should.

Finishing up

Save your world. You can do this in one of three ways:

  1. You can save it to your USB Flash drive, and then email me the final product as an attachment to agw ATSIGN dsm.fordham.edu.
  2. You can save it in your home directory on erdos (better yet, in a dedicated subdirectory of same), and then send me an email telling me where it may be found, say, as ~janeuser/Alice/alice-3.a2w, where (of course) you should specify your own home directory, rather than Jane's.
  3. Save your Alice world as a movie (via File→Save as Video—if you have trouble figuring out the steps, send me an email). Drag the resulting video file to someplace reasonable within your erdos home directory (found in the Students folder on your desktop). Now send me an email telling me how to find this file, say as ~janeuser/Alice/alice-3.mov .
The last way is most convenient for me (but may be the least convenient for you).

End of Part III Continue to Part IV.