GIGA-uwindsor/Spider-Fish.js — Issue #34: WanderingInvader.destroyOthers code in wrong place
Author: drouill8
Created: 2012-01-25 21:17:12+00:00
State: open

The state of the aabb tree is only valid within the "colliding process", accessing the tree any other time can result in undefined behaviour.

The aabb tree is built with the index of the entities in the entities array. If the aabb tree is used during the update/draw/destroy calls, those indexes may no longer be correct since entites with their removeFromWolrd flag set are removed from the array at the end of the update process.

the destroyOthers code should be moved over into the collide method of the Explosion class, or a new DeadlyExplosion class