Alice Community  

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

Reply
 
Thread Tools Display Modes
Urgent help needed!!
Old
IJMcG
Guest
 
Status:
Posts: n/a
Default Urgent help needed!! - 09-23-2009, 01:50 PM

i'm putting together a biking game and have made a biker so that you press A to make him perform half a pedal, then use S to make him complete a full pedal. However, I want to know if there's anyway to make it so the user MUST press A first before they can press S? Then once the user presses S is there any way to make it so they can't press S again until they press A?

I think it has something to do with using variables or equations but i don't exactly know how to use them yet. help would be GREATLY appreciated thank you
   
Reply With Quote
Old
reuben2011
Senior Member
 
reuben2011's Avatar
 
Status: Offline
Posts: 489
Join Date: Sep 2009
Location: Hawaii
Default 09-29-2009, 04:29 PM

There is a way to do this. I'm assuming you have two different methods for the "a" and "s" keys. Make a world variable, name it something and set the value to true. Now in your "a" method, put everything in a "if" structure. Make the condition that the variable you made has to be true and make "else" do nothing. Also, in the "a" method in the end of the "if" set the variable to "false". Now for the "s" variable, do the same thing but make the condition for the variable to be false and set the variable at the end of the "if" statement to true. Hopefully, by doing this the player will have to repeatedly press one key then the other to move the bike (I hope this is what you were trying to ask).
   
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 ©2023, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.