Quote:
Originally Posted by Awesomeness
Thanks. By the way, I know what recursion is. I'm new to Alice but I'm a decent programmer in three languages. However, I have a bunch questions regarding Alice:
What caused the error? Is it a problem on my part or is it a problem with Alice? And why do you have to use two separate events? (How do you even get to changing values and stuff when you press a key? I only see methods in the drop down menu.) By the way, wouldn't an of statement be much better than a while loop since if you use a while loop you get deeper and deeper in multiple while loops?
|
The error was caused by the walk method in the "During" part of the event, which you can never do with an infinite loop (it is a bug in Alice that they have not fixed). It is basically trying to stop your method mid code, so it is trying to stop the TRex from walking while it is still putting its foot forward. For this program, it wouldn't matter that there would be multiple while loops, I just did it as a quick example, but in larger programs it would make a big difference in terms of lag, so yes you would have to fix that.
Check out my best projects so far and please comment:
Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301