I have a real trouble about that. When i work with entities in complex functions there is problem about checking for is an Entity signed for removing or not.
This one doesn’t work instant
if(entity.world != null)
So i’m always putting another variable to base Entity class
public var _removed:Boolean = false;
Then everything perfectly works when i use this variable to check is it removed or not, but i have to use 2 lines to remove an entity in this way
this.world.remove(otherentity);
otherentity._removed = true;
that works instantly and i’ve no trouble anymore because i’m checking _removed for any entity to be sure it is not removed.
But, i want to learn “standart” way to solve this problem in Flashpunk, can you help me?