Nevermind, found a good solution.
Although you’ve now deleted the original post’s comment. Perhaps just post a link to the optimizer as others may also find it useful?
The original post was inquiring about a way to combine adjacent ‘Pixel’ objects into ‘Line’ objects, that were used for collision detection. So if one pixel is at point (0, 0) and another is at (0, 1) and another is at (0, 2), these three should form one Line, going from (0, 0) to (0, 2).
It becomes slow when checking collisions when there are millions of ‘Pixel’ and ‘Line’ objects which was why I wanted to start combining them… However, I decided instead to split the game into many ‘regions’ (sections of the map that are 512x512 pixels), each storing an array of collision data, so it would only check the collision data for the current region a player is in.
That was the solution I came up with… Although I would still like to implement something like I first stated, I will do it at some other time (I will have to do it myself, I don’t think anyone has done & released this). If I do do it, I will probably release on this thread.