Alice 2.5

What

Alice, go to AliceFileImport. Once you have the import window open, choose the sound file that you would like to play in Alice. Importing Sounds into Alice. I have imported my “aliceMusic.mp3” file into the world. Once you have selected the sound file you want to import from the import window earlier, we need to locate the. Alice 2.5 App Alice 2 has a proven record as a great tool for learning logical and computational thinking skills and fundamental principles of programming. While it does not support the more advanced scaffolding of Alice 3 it remains a great first experience with the Alice environment and an option for a first step into the Alice world. USING ALICE 2.5 (THE PROGRAMMING APPLICATION) ANY HELP IS APPRECIATED Choose a ride object other than the carousel from the Amusement Park gallery that moves in a circular pattern (a round-and-round manner, like the Ferris wheel). Create a method that performs an animation appropriate for the ride object selected. Don’t leave anything behind on your Alice Lake backpacking trip. Grab my Packing Checklist below! In this freebie, you’ll get access to: A Full Backpacking Gear Checklist for 2-5 Day Backpacking Trips. A Visual Backpacking Gear Checklist. Layering Essentials Tip-Sheet. 25+ Backpacking Food Ideas for your upcoming Alice Lake Hike.

A class-level method defines the behavior for a single character (object).

Step 1:How to create a class-level method:

  • In our example world, click on the turtle in the object tree (upper left panel).
  • In turtle's details (lower left panel) click the method tab and then the button 'create new method'. Name it 'walk'

Step 2:How to write a method:

  • We want to move the turtle's legs back and forth as the turtle moves forward. First, drag the control statement 'do in order' from the bottom of the window, into the editor.
  • Next, in the object tree, click on the + beside 'turtle' to see the different body parts. Drag the frontLeftLeg into the method. Select turn - backward. Choose other and type in 0.1.
  • Finally, click 'more' at the end of the turn command and choose duration = .25 seconds. The default time for an action to be performed is 1 second. We are changing it to 0.25 so that it will happen faster.
  • Next, we want the turtle to move forward at the same time that the back leg goes forward So drag in the control statement 'do together.'
  • Finish dragging and dropping the instructions until your method looks like this:
  • Finally, add a comment to your method to tell someone reading your code what it does. Your comment can say: “Move the turtles legs back and forth”
  • Remember: This comment is not Alice code. It is simply an explanation for someone trying to understand your code. Alice ignores the comments when it plays your world.
Games

Step 3:To call your method:

  • Click on world.myfirstmethod to get back to it and then drag turtle.walk into it. Push the 'play' button to watch the turtle walk.

Step 4:Writing a method for kangaroo:

  • In the object tree, click on kangaroo. In kangaroo's details, click the button 'create new method' and name it 'hop'
  • To write the method, drag and drop the following instructions into your method. Your first step is to drag a 'do together' into the method.
  • To find the 'lowerleg' of the kangaroo, you click the + beside the leg tab. When you finish, your method should look like this:

Part One of the Code:

Part Two of the Code:

Alice 2.5 program
  • Remember, to call your method to test it, click on world.myfirst method to get back to it and then delete what you have there. Drag kangaroo.hop into it. Push the 'play' button to watch the kangaroo hop.

The Alice 2.2 programming environment includes the heBuilder and sheBuilder objects that allow programmers to custom build characters. The other advantage of these objects is that they include a number of predefined animations, including a walking animation, together with several other animations. Now I’m a programmer, not an animator, so I welcome any pre-existing animations, and in my opinion the animations that come with these builder objects are pretty good.

Cars

The heBuilder and sheBuilder classes can be found in the gallery: look under Home > Local Gallery > People. The builder classes then enable you to build custom characters, by selecting various features. The interface is fairly straightforward, and is like the character builder for the Wii (not as many options though).

Once you have created a custom character, you can then make use of the pre-defined methods. Methods include a walking animation, together with several “emotion” animations, such as angry, confused, happy etc.

The following video tutorial demonstrates how these methods can be used. To do this we use several “when key is pressed” events to control the character. To get the character to walk forward we combine the walking animation with the move forward method.

Walking while key is pressed

Alice 2.5 Collision Detection

Programming the character to walk when the key is pressed is fairly straightforward and is described in the video shown above. However programming the character to walk while the key is pressed is not so easy. If we try to call the same walk forward method that we use for the “when key is pressed event” the program generates an exception. This is because the while key is pressed event stops executing the code that it executes while the key is pressed as soon as the key is released. This is problematic for the walk method – terminating the method mid-way through leads to this execution. What we need is some way to finish executing the code in the walk method.

To do this we introduce a simple two-state finite state machine. The states for this FSM are walking and idle. Whenever the FSM is in the walking state, we run the walking animation. Whenever the FSM is in the idle state the walking animation is not run. To represent the state we use a boolean valued variable, called walking. The variable is true when the FSM is in the walking state and false otherwise. If there were more than two states we would need to represent the state in another way – perhaps using a string.

Putting this all together, we use the “While key is pressed event”. At the beginning of event we change the walking state to true. This triggers the walking animation action. During the key press event the character moves forward. At the end of the key press event the walking state is changed to false. At this point the walking animation action is stopped, but not until the code for the current call is completed, thus avoiding the termination of code mid-way through.

Alice 2.5 Simulator

Ok, that is probably all a bit convoluted, so lets go to the video.