PDA

View Full Version : First year at Alice - Questions


mikerd
06-20-2007, 09:49 PM
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