alice-teacher Tip of the week

Wanda Dann wpdann at andrew.cmu.edu
Fri Oct 15 09:28:08 EDT 2010


> In Alice 2.2, I am trying to get a fish's fins to constantly move as the world executes, while the rest of the program executes. Is there a simpler way to do this than have to constantly call the finMotion method as part of a doTogether everywhere in the program. (A musical analogy would be having a soundtrack playing in the background while the program executes, but I want an animation to constantly execute)
> 

Create a swim motion method for your fish...

Create a new event for "When the world starts...".

Then,  right click on the event tile and from the pop-up menu select "change to"
and "While the world is running".

If you want something to happen once, as the world starts to execute, call that method in the "BEGIN" part of the event

Finally, in the "DURING" part of the event call the fish's swim method.

You will probably not be able to do anything useful in the "END" part of the event

This will cause the fish's tail to "swim" all the time that the animation is
executing.

See the attached BunnyHop world as an example.

Wanda
Steve
Don
-------------- next part --------------
A non-text attachment was scrubbed...
Name: BunnyHop.a2w
Type: application/octet-stream
Size: 308619 bytes
Desc: not available
Url : https://lists.andrew.cmu.edu/mailman/private/alice-teachers/attachments/20101015/cc1abc03/attachment-0001.obj 
-------------- next part --------------





More information about the alice-teachers mailing list