View Single Post
Using Event "While a key is typed" with walking
Posts: n/a
Default Using Event "While a key is typed" with walking - 06-12-2009, 11:40 AM

Using Alice 2.2, I want a walking character to be controlled by the arrow keys. I created a new event that was "When a key is typed." When the left and right keys are typed, I have the object turn left and right. When the up key is typed, I have the object walk forward howFar=2. This also works. I also created a backward walking method by changing the "move forward" to "move backward". So far so good.

However, I right-clicked on each event and changed them to "While a key is pressed" because this is what I really want. The left and right turning still work fine but for the forward and backward walking, there is a problem. It works as long as you keep holding down the key but as soon as you let go, I get a message that there was an error in the simulation.

I have tried this with the walking Zeus and walking Cowboy. I got the same error for both characters. Attached is a simple world showing what I mean.

Any ideas?
Attached Files
File Type: a2w Cowboy Controls.a2w (987.6 KB, 30 views)
Reply With Quote