Alice Community  

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

Thread Tools Display Modes
Prev Previous Post   Next Post Next
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

alice 2.2, error message, events, walking

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.