Alice Community  

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

Reply
 
Thread Tools Display Modes
How do I make an object do something different if clicked on twice?
Old
bobsaget219
Junior Member
 
Status: Offline
Posts: 2
Join Date: Sep 2011
Default How do I make an object do something different if clicked on twice? - 09-09-2011, 07:22 AM

Im doing a project and ive only been working with Alice for about 5 days and the project goes like this: I need to make a scene where a scientist turns green when a lever is pulled once, then when the same lever is pulled again, the scientist returns to normal color. I was wondering how can I make the lever do a different command than the first one (turn him into normal instead of staying to green and doing both commands at once)
   
Reply With Quote
Old
x08
Junior Member
 
Status: Offline
Posts: 8
Join Date: Aug 2011
Location: Melbourne, Australia
Default 09-10-2011, 02:44 AM

Use a variable and an if statement.
   
Reply With Quote
Old
DensetsuNoKaboom
Senior Member
 
DensetsuNoKaboom's Avatar
 
Status: Offline
Posts: 1,188
Join Date: May 2010
Location: e4eaf2
Default 09-10-2011, 06:57 AM

To clarify a bit:

Make a new Boolean variable, and set its value to false. Then add an if/else statement that says, if the variable is true, set the scientist's color to normal AND set the variable to false, else set the scientist's color to green AND set the variable to true.


Thank you for taking the time to read this signature. This signature loves you.
   
Reply With Quote
Old
bobsaget219
Junior Member
 
Status: Offline
Posts: 2
Join Date: Sep 2011
Default 09-12-2011, 07:35 AM

im still having a little trouble. Here's what I got:
T/F variable=False
If=true
World.2nd lever touch (when he turns to normal color)
Variable set value to false
Else
lever.mount.handle turn forward .25 revolutions
mad scientist set color to green
Variable set value to true

Hope this helps a bit
   
Reply With Quote
Old
GameKid
Senior Member
 
GameKid's Avatar
 
Status: Offline
Posts: 467
Join Date: May 2011
Location: My magnificent castle
Default 09-18-2011, 04:45 PM

As denetsu said in another thread, you have to make the variable world-wide.
Select World and go to properties. Click the button that says "Create new variable". Use that variable instead of a variable made in a method.


[COLOR=e4eaf2]Your text here[/COLOR]
Come on, you know you want to try it.
   
Reply With Quote
Old
adams34
Guest
 
Status:
Posts: n/a
Default 09-25-2011, 10:10 AM

Make a new Boolean variable, and set its value to false. Then add an if/else statement that says, if the variable is true, set the scientist's color to normal AND set the variable to false, else set the scientist's color to green AND set the variable to true.
   
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 ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.