Alice Community  

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

Reply
 
Thread Tools Display Modes
Disable movement by arrow keys temporarily?
Old
Revolt
Member
 
Revolt's Avatar
 
Status: Offline
Posts: 33
Join Date: Oct 2010
Default Disable movement by arrow keys temporarily? - 08-26-2011, 06:19 PM

I've seen similar questions to mine, but I still cannot understand how to do this. In the top right of Alice, there are the EVENTS, if I assign the arrow keys to move the camera using the event, how can I disable them until an action is performed (in this case the user chooses a mode to play in, and after the selection has been made I'd like to enable movement)? I know I need to use variables somehow, however I don't know exactly how. Screenshots/Examples of temporarily disabled movement would be greatly appreciated.


Rock, Paper, Scissors, Chuck Norris. Rock wins.

And by rock, I really mean Chuck Norris.
   
Reply With Quote
Old
beachbum111111
Senior Member
 
beachbum111111's Avatar
 
Status: Offline
Posts: 852
Join Date: Feb 2010
Location: e
Default 08-26-2011, 06:49 PM

Try to make a variable and make it so if the variable is set to 1 then the arrow key works, if it is at 0 then it doesn't.


"Don't lead me into temptation I can find it myself"
   
Reply With Quote
Old
Dj Tech42
Senior Member
 
Dj Tech42's Avatar
 
Status: Offline
Posts: 203
Join Date: Feb 2011
Default 08-26-2011, 07:58 PM

Make sure you drag an if/else statement into the method area of the event. Before you do that, drag what you have in the event so far to the clipboard, drag the if/else block in and paste the method(s) back in. Make a boolean variable called "Controlsenabled" or something similar. Set it to false. When you want the controls to work, set it to true. Go to your if/else block and set to "if Controlsenabled."


Flight Simulator with Dogfight Modes:
http://www.alice.org/community/showthread.php?t=6840
   
Reply With Quote
Old
Revolt
Member
 
Revolt's Avatar
 
Status: Offline
Posts: 33
Join Date: Oct 2010
Default 08-26-2011, 08:33 PM

Thanks for the help! It works now


Rock, Paper, Scissors, Chuck Norris. Rock wins.

And by rock, I really mean Chuck Norris.
   
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.