dist/carrot.js
/**
     * Adds a child to the world container. The child can be a sprite or a group.
     *
     * @method Carrot.World#addChild
     * @param {Carrot.Group | Carrot.Sprite} entity - The entity to add.
     */
Adds a child to the world container. The child can be a sprite or a group.
Adds a child to the world container . The child can be a sprite or a group .
addChild(entity)
    {
        if (entity.parent !== this)
        {
            entity.parent.removeChild(entity);
        }
        this.children.push(entity);
        entity.parent = this; 
    }
addChild ( entity ) { if ( entity . parent !== this ) { entity . parent . removeChild ( entity ) ; } this . children . push ( entity ) ; entity . parent = this ; }
Adds a child to the world container.
Adds a child to the world container .
// Remove from old parent, if existing // Add to world // Update parent