Alice Community  

Go Back   Alice Community > General Discussion > Questions and Comments

Reply
 
Thread Tools Display Modes
How to run the same method multiple times, simultaneously?
Old
Qazzquimby
Junior Member
 
Status: Offline
Posts: 2
Join Date: Sep 2013
Default How to run the same method multiple times, simultaneously? - 11-01-2013, 08:25 PM

Basically the title. I'm using 2.3.5 if it matters.
When an event is run, it normally waits until it's complete before running again. Is there a way to get around that, and have it run whenever triggered, even if it's already running?
   
Reply With Quote
Run the same event
Old
djslater107
Administrator
 
Status: Offline
Posts: 155
Join Date: Jan 2007
Default Run the same event - 11-02-2013, 09:11 AM

In Alice 2, this is not easily done... Alice 3 actually has modifiers in its events that would allow this action to happen...

I do not know if this will help, but if you right click on the key press event or the mouse click event (when key is presses, when mouse is clicked), the drop down menu gives you a choice to "change to" so that these events can become "while key is pressed", "while mouse is held"


Don Slater
Alice Team
Carnegie Mellon University
   
Reply With Quote
Old
Qazzquimby
Junior Member
 
Status: Offline
Posts: 2
Join Date: Sep 2013
Default 11-02-2013, 05:35 PM

I've tried that and while it allows the method to run multiple times, it causes a lot of strange problems, including that instance of the method stopping as soon as you release the key.

It seems like a really fundamental thing. Is there a good example of a project with a work around?
   
Reply With Quote
Try this for your problem
Old
clk4suport
Junior Member
 
Status: Offline
Posts: 12
Join Date: Nov 2013
Location: new delhi
Default Try this for your problem - 11-22-2013, 02:48 AM

http://stackoverflow.com/questions/8...sly-in-c-sharp

Please try link i think it may help you.
   
Reply With Quote
There is always a way
Old
MrMoke
Senior Member
 
MrMoke's Avatar
 
Status: Offline
Posts: 501
Join Date: Sep 2007
Location: Austin, Texas
Smile There is always a way - 11-24-2013, 03:36 PM

Quote:
Originally Posted by Qazzquimby View Post
I've tried that and while it allows the method to run multiple times, it causes a lot of strange problems, including that instance of the method stopping as soon as you release the key.

It seems like a really fundamental thing. Is there a good example of a project with a work around?
First: It's difficult to answer such a general request. If you're talking about recursion, then Yes Alice can do that.

Next: The "While a key is pressed" option, can call Begin:, During:, and End: methods. An example would be B:Turn the front wheels on a vehicle slightly to the right, D:Turn vehicle slightly right as long as key is pressed, E:Straighten wheels out again.

Lastly: What specifically was it that you had in mind?
   
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 ©2020, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.