Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   Teaching with Alice (http://www.alice.org/community/forumdisplay.php?f=25)
-   -   First year at Alice - Questions (http://www.alice.org/community/showthread.php?t=819)

mikerd 06-20-2007 09:49 PM

First year at Alice - Questions
 
A couple of extremely dedicated students refuse to hand in their project with bugs and wanted me to ask the group for assistance. One of the problems has to do with sounds, but I haven't sufficiently checked the community threads, so I'll hold off. The other is related to collision checking and lists.

Any help would be appreciated by the students. I'm happy with the game as is.

The game:
A game with 200 gems. Dragon walks around, when it touches a gem it disappears and adds to the total score.
The problem:
1) The loop to check for collisions takes too long. The dragon would have to wait by a gem for a couple seconds before it registered.
2) Is there a way to dynamically delete items from a list? an array? So that at least it will speed up over time.

Things tried:
1) Using lists and arrays (no visible difference, however to create a list and add 200 gems required 3 restarts as each item added caused a bad memory leak (was up to 1Gig of memory at one point)
2) Using distanceTo or isCloseTo didn't seem to make too much difference. isCloseTo seemed a little faster. I haven't got them to try a combination of distanceInFront/distanceBehind. Would that help?
3) All together, or one at a time: All together much faster


All times are GMT -5. The time now is 11:10 PM.

Copyright ©2017, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.