PDA

View Full Version : How to run the same method multiple times, simultaneously?


Qazzquimby
11-01-2013, 09: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?

djslater107
11-02-2013, 10: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"

Qazzquimby
11-02-2013, 06: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?

clk4suport
11-22-2013, 03:48 AM
http://stackoverflow.com/questions/8815147/run-a-method-multiple-times-simultaneously-in-c-sharp

Please try link i think it may help you.

MrMoke
11-24-2013, 04:36 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?

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?