TurnOffTiles* TurnOffTiles::create(float duration, const Size& gridSize)
{
    TurnOffTiles* action = new (std::nothrow) TurnOffTiles();
    if (action && action->initWithDuration(duration, gridSize, 0))
    {
        action->autorelease();
        return action;
    }
    
    delete action;
    return nullptr;
}
TurnOffTiles* TurnOffTiles::create(float duration, const Size& gridSize)
{
    TurnOffTiles* pAction = new TurnOffTiles();
    if (pAction->initWithDuration(duration, gridSize, 0))
    {
        pAction->autorelease();
    }
    else
    {
        CC_SAFE_RELEASE_NULL(pAction);
    }
    return pAction;
}
예제 #3
0
TurnOffTiles* TurnOffTiles::create(float duration, const Size& gridSize, unsigned int seed)
{
    TurnOffTiles *action = new TurnOffTiles();

    if (action)
    {
        if (action->initWithDuration(duration, gridSize, seed))
        {
            action->autorelease();
        }
        else
        {
            CC_SAFE_RELEASE_NULL(action);
        }
    }

    return action;
}