I have the X and Y coordinates of all my Actives stored in an Array. Each consecutive Y index holds the X and Y coordinates for each object in X index values 1 and 2 (so to visualize: two columns, left =x, right =y). I am calling the objects to be created when the player's X position is within 200 pixels on either side of the X coordinate. Then, the objects are destroyed when player is out of range, and recreated when he enters the pixel range again. This requires only 4 events, 2 create and 2 destroy, one for either side of the object. For neatness sake, I'd like to avoid having a bazillion individual conditions to create each object.

After each object is created, I am adding 1 to the y-index so I can check for the next object's coordinates. Everything is working perfectly until I create objects with their 400-pixel range boxes intersecting. At this point, it looks like the y-index is getting confused since it's searching between two values, so everything goes haywire.

Has anyone attempted this and have a better way to do it?