Enhance Surface.find_non_colliding_position
Posted: Sat Jun 18, 2016 11:31 pm
The current Surface.find_non_colliding_position is very useful for finding places to spawn entities, but there are times I want to find positions that won't collide, but also ignore checking collisions with certain types of entities (trees, I am looking at you!).
So if Surface.find_non_colliding_position could take a 5th parameter, an optional list of entity names to ignore when checking for a non-colliding position, it would be very useful.
Right now, the only workaround is to create a list of the entities, store their position/orientation/state, destroy them, call Surface.find_non_colliding_position and then re-create the entities ifif you don't spawn anything. Which is terrible for performance, and a lot of code.
So if Surface.find_non_colliding_position could take a 5th parameter, an optional list of entity names to ignore when checking for a non-colliding position, it would be very useful.
Right now, the only workaround is to create a list of the entities, store their position/orientation/state, destroy them, call Surface.find_non_colliding_position and then re-create the entities ifif you don't spawn anything. Which is terrible for performance, and a lot of code.