Alice Community Real Combination Lock
 User Name Remember Me? Password

 Thread Tools Display Modes
 Real Combination Lock
 facilitator22 Guest   Status: Posts: n/a Real Combination Lock - 05-12-2011, 01:25 PM I need to make a combination lock turn and keep turning when you hit the left key(same for the right key). Also i need to make it stop using the up arrow key. I can do that but the hard part is getting it to recognize a combination. I don't know to make it work like an actual lock so if you could help PLEASE!
 Dameria Senior Member     Status: Offline Posts: 978 Join Date: Sep 2009 Location: United States 05-12-2011, 04:16 PM To make it keep turning, you use a "When key is pressed" event, and then right click it and change it to "While key is being pressed", and then in the "During" section of that you put code to turn the lock just a very small amount instantly with a duration of close to "0" so that it can happen pretty fast (mess around with duration to make the lock rotate faster or slower). Then you would have to use trigonometry to find the rotation that the lock is currently set to, and use a fraction of the degree angle to calculate approximately what number it would be set at. If you haven't taken trigonometry then you probably don't know how to use the sine, cosine, and tangent functions, so idk how else you could do it easily. Cosine would most likely be used, but idk, im guessing on that one. Its not easy unless you know what your doing. Check out my best projects so far and please comment: Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548 Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408 Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725 Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
 sfunk Senior Member     Status: Offline Posts: 1,112 Join Date: Mar 2011 Location: I don't know 05-12-2011, 05:01 PM you could just use dummy objects so once one is in the vacinity of the right combination it will activate your method If you are stuck on a project, check out the tutorials I made here at this link: http://alice.org/community/showthread.php?p=36778#post36778 There are lots of tutorials on it so far, including some youtube videos, check it out Or.. Go to my youtube channel to check out my alice 2.2 tutorials I have there.. http://www.youtube.com/user/sfunk1992?feature=mhsn
 facilitator22 Guest   Status: Posts: n/a 05-13-2011, 11:01 AM I know how to use cos sin and tan. But i don't understand what you mean when you say use angles to make it find the number its suppose to go to. Maybe I didn't explain it right. The project is make the lock turn clockwise 2 times then to 21. Then counterclockwise to 5. Then clockwise to 18. You need to make it turn left when you hit the left key and right on the right key. Then stop when you hit up.
facilitator22
Guest

Status:
Posts: n/a
05-13-2011, 01:17 PM

Quote:
 Originally Posted by sfunk you could just use dummy objects so once one is in the vacinity of the right combination it will activate your method
Thanks i think i got it figured out

 Dameria Senior Member     Status: Offline Posts: 978 Join Date: Sep 2009 Location: United States 05-14-2011, 10:19 AM Oh sorry I didn't know it was just a simple animation lock turning method. That can easily be done with rotating the centerpiece of the lock to either the left or the right at certain numbers, you would have to guess and check your way by going higher or lower depending on how far off you are each time you run the program. Check out my best projects so far and please comment: Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548 Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408 Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725 Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301

 Thread Tools Display Modes Linear Mode

 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 Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Announcements     Community News and Announcements Alice 3     How Do I?     Works In Progress     Share Your World     Share Custom Classes     Bugs and Trouble Shooting     Suggestion Box Alice 2     How do I...?     Works-In-Progress     Share Worlds     Share Objects     Bugs and Troubleshooting     Suggestion Box Educators     Teaching with Alice     Teaching Using Alice 3     Teaching Using Alice 2     CS Principles and Alice     AP CSA and Intro to Java and Alice     Workshops General Discussion     Questions and Comments     The Lounge