dist/carrot.js
/**
     * Adds an entity to a group. The entity can be a sprite or another group.
     *
     * @method Carrot.Group#addChild
     * @param {Carrot.Group | Carrot.Sprite} entity - The entity to add.
     */
Adds an entity to a group. The entity can be a sprite or another group.
Adds an entity to a group . The entity can be a sprite or another group .
addChild(entity)
    {
        if (entity.parent !== this)
        {
            entity.parent.removeChild(entity);
        }
        if (entity.active)
        {
            this.children.push(entity);
        }
        else
        {
            this.inactives.push(entity);
        }
        entity.parent = this; 
    }
addChild ( entity ) { if ( entity . parent !== this ) { entity . parent . removeChild ( entity ) ; } if ( entity . active ) { this . children . push ( entity ) ; } else { this . inactives . push ( entity ) ; } entity . parent = this ; }
Adds an entity to a group.
Adds an entity to a group .
// Remove from old parent // Add to group // Update parent.