Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
Method as Trigger for Other Method?
Old
jw234
Guest
 
Status:
Posts: n/a
Default Method as Trigger for Other Method? - 03-30-2008, 12:34 PM

I want one object's method to trigger a separate object's method, like once the carousel turning animation starts (by, say, a mouse-click) then the monkey begins screeching.

How can I do this?

To clarify: I don't want the reactions to be time-programed like a movie; I want the monkey to only screech is the carousel turns, and if the carousel never turns, then the monkey never screeches. I also don't want some other arbitrary trigger to be required (like the monkey's distance to the carousel, or anything).

Thank you for any help you can offer.
   
Reply With Quote
Old
DickBaldwin
Guest
 
Status:
Posts: n/a
Default 03-30-2008, 02:06 PM

Quote:
Originally Posted by jw234 View Post
I want one object's method to trigger a separate object's method, like once the carousel turning animation starts (by, say, a mouse-click) then the monkey begins screeching.

How can I do this?

To clarify: I don't want the reactions to be time-programed like a movie; I want the monkey to only screech is the carousel turns, and if the carousel never turns, then the monkey never screeches. I also don't want some other arbitrary trigger to be required (like the monkey's distance to the carousel, or anything).

Thank you for any help you can offer.
Just put a call to the monkey method inside the carousel method. Methods call other methods all the time in programming.

Dick Baldwin
Free Alice tutorials: http://www.dickbaldwin.com/tocalice.htm
Free programming tutorials: http://www.dickbaldwin.com/toc.htm
   
Reply With Quote
Think This Does It, JW
Old
pinckneyb
Guest
 
Status:
Posts: n/a
Smile Think This Does It, JW - 03-30-2008, 03:37 PM

JW -

I believe this Alice "world" (.A2W file) that I've attached does what you're talking about. This is new territory to me (English prof, trying to learn some programming so as not to live only in the 19th c), so this was good practice.

Let me know if this was what you meant.
Attached Files
File Type: a2w monkeyhatecarousel.a2w (984.1 KB, 111 views)
   
Reply With Quote
Alice makes poets of us all
Old
pinckneyb
Guest
 
Status:
Posts: n/a
Default Alice makes poets of us all - 03-30-2008, 03:43 PM

Also, I've got to say:

You could easily publish, in GLIMMER TRAIN, or AMERICAN POETRY REVIEW, maybe, a poem called "Monkey Method" that started with the lines

Just put a call to the monkey method
Inside the carousel method
Methods call other methods
All the time

FWIW
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2020, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.