Alice Community  

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

Reply
 
Thread Tools Display Modes
Help please - Press 4 button
Old
bearmui
Guest
 
Status:
Posts: n/a
Default Help please - Press 4 button - 05-24-2011, 10:24 AM

A fan has 4 button - off/high/medium/low. How can I click on a button, the button changes to half-size. Then if another button is pressed, the first button with half-size can be changed back to its original size.
   
Reply With Quote
Old
jediaction
Senior Member
 
jediaction's Avatar
 
Status: Offline
Posts: 5,064
Join Date: Jul 2009
Location: Bel Air, Maryland
Default 05-24-2011, 10:24 AM

What exactly do you mean. I think I can help


Website: www.salokingames.com
FaceBook: www.facebook.com/SalokinGames
   
Reply With Quote
Old
bearmui
Guest
 
Status:
Posts: n/a
Default 05-24-2011, 11:07 AM

Please see the attached file and could you please let me know how to do the following:

After I click the first button (eg. button 2), the first button (i.e. button 2) resize to half size (half as big/0.5). After that, I press another button (e.g. button 3), the first button (i.e. button 2) will change back to original size (twice as big/2) and the other buttons (i.e. button 0 & 1) will remain unchange.

I really need your help. Many thanks.
Attached Files
File Type: a2w fan.a2w (1,009.1 KB, 2 views)
   
Reply With Quote
Old
jediaction
Senior Member
 
jediaction's Avatar
 
Status: Offline
Posts: 5,064
Join Date: Jul 2009
Location: Bel Air, Maryland
Default 05-24-2011, 12:09 PM

Im sorry. For somereason I cannot figure this out. I have some of these problems to with my Halo game. But This one is a little bit more tricky than the others. I did manage to get the buttons moving up and down when pressed, but the double size I did not. Also, I am pretty sure the problem has to do with your method with the looping. I got rid of the looping and it still worked. See what you can do from here...
Attached Files
File Type: a2w fan.a2w (1,017.8 KB, 1 views)


Website: www.salokingames.com
FaceBook: www.facebook.com/SalokinGames
   
Reply With Quote
Old
reuben2011
Senior Member
 
reuben2011's Avatar
 
Status: Offline
Posts: 489
Join Date: Sep 2009
Location: Hawaii
Default 05-24-2011, 05:25 PM

bearmui, you could have a lastClicked variable and everytime you click another button, the object assigned to lastClicked would return to normal size while the object that the user just clicked would change in size. Then you set the button that was just clicked to lastClicked. I hope this helps.


Projects
-Escape the Kitchen
-That ninja animation
-Hill Collision

Upcoming Projects
-Some penguin adventure game?
   
Reply With Quote
That was Fun
Old
MrMoke
Senior Member
 
MrMoke's Avatar
 
Status: Offline
Posts: 501
Join Date: Sep 2007
Location: Austin, Texas
Default That was Fun - 05-24-2011, 06:12 PM

You might be better off by simply moving the clicked button down by maybe .01 and then back up again when another is clicked.
The fact that the name of the fan was passed when I clicked on any one of the buttons caused me to have to build a click event for each button, although I called only one method to do the changes.
If you use arrays, things could get easier.
   
Reply With Quote
Old
bearmui
Guest
 
Status:
Posts: n/a
Default 05-24-2011, 09:54 PM

Quote:
Originally Posted by reuben2011 View Post
bearmui, you could have a lastClicked variable and everytime you click another button, the object assigned to lastClicked would return to normal size while the object that the user just clicked would change in size. Then you set the button that was just clicked to lastClicked. I hope this helps.
reuben2011, can you show me how the object set lastClicked variable? Thx!!!
   
Reply With Quote
Old
bearmui
Guest
 
Status:
Posts: n/a
Default 05-24-2011, 10:03 PM

Quote:
Originally Posted by jediaction View Post
Im sorry. For somereason I cannot figure this out. I have some of these problems to with my Halo game. But This one is a little bit more tricky than the others. I did manage to get the buttons moving up and down when pressed, but the double size I did not. Also, I am pretty sure the problem has to do with your method with the looping. I got rid of the looping and it still worked. See what you can do from here...
Thanks a lot!
   
Reply With Quote
Old
reuben2011
Senior Member
 
reuben2011's Avatar
 
Status: Offline
Posts: 489
Join Date: Sep 2009
Location: Hawaii
Default 05-25-2011, 02:18 AM

I'll make an example with different objects so that you can get the concept, but so you can't use my work for classwork (if that is what you are doing.)

EDIT: Here it is. Using my favorite object from the Alice gallery.
Attached Files
File Type: a2w Example1.a2w (1.41 MB, 1 views)


Projects
-Escape the Kitchen
-That ninja animation
-Hill Collision

Upcoming Projects
-Some penguin adventure game?

Last edited by reuben2011; 05-25-2011 at 03:12 AM.
   
Reply With Quote
Old
bearmui
Guest
 
Status:
Posts: n/a
Default 05-25-2011, 03:10 AM

Quote:
Originally Posted by reuben2011 View Post
I'll make an example with different objects so that you can get the concept, but so you can't use my work for classwork (if that is what you are doing.)
Yep, please. I've read the textbook but still couldn't figure it out how I can set the lastclicked variable.
   
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.