Tuesday 15 March 2011

actionscript 3 - how to efficiently track the use of space on a map, both objects and free areas -


OK I start with an empty map, which is 512x512 = 262144 pixels / space.

I need this to have a way of attracting some objects effectively, and then be able to find areas of vacant space, so that later in these free areas more and more different objects are added Can go I can not figure out the best way to store this data, or find algorithms to search for free areas.

I had a working solution, but to calculate it was taken forever, I am working with AS3, if this effect is the best solution.

Any advice? Thank you. There are many ways to work with bitmap in bitmap and bitmapdata classes.

I have not done anything like that, but you can try, I believe that objects on the map Is the best way to attract. Then, use the method to get those fields bitmapData.getColorBoundsRect (), which are not free. These AS3 basic methods are very, very fast!

These documents are:

Cheers, Cathotians!


No comments:

Post a Comment