def remove_entity(self, entity, second=False):
        '''
        Removes entity from world and kills entity
        '''
        if entity in self._entities:
            if second:
                for group in self._groups.keys():
                    if entity in self._groups[group]:
                        self.deregister_entity_from_group(entity, group)
                self._entities.remove(entity)
            else:
                entity.kill()
        else:
            raise UnmanagedEntityError(entity)
def remove_entity ( self , entity , second = False ) : if entity in self . _entities : if second : for group in self . _groups . keys ( ) : if entity in self . _groups [ group ] : self . deregister_entity_from_group ( entity , group ) self . _entities . remove ( entity ) else : entity . kill ( ) else : raise UnmanagedEntityError ( entity )
Removes entity from world and kills entity