Пример #1
0
SushiSprite *SushiSprite::create(int row, int col)
{
	SushiSprite *sushi = new SushiSprite();
	sushi->m_row = row;
	sushi->m_col = col;
    sushi->m_imgIndex = rand()% TOTAL_SUSHI;
    sushi->initWithSpriteFrameName(sushiNormal[sushi->m_imgIndex]);
	sushi->autorelease();
	return sushi;
}
Пример #2
0
SushiSprite * SushiSprite::create(int x, int y)
{
    SushiSprite *sushi = new SushiSprite();
    
    sushi->setX(x);
    sushi->setY(y);
    sushi->init();
    
    sushi->autorelease();
    return sushi;
}
Пример #3
0
SushiSprite *SushiSprite::create(int row, int col)
{
	SushiSprite *sushi = new SushiSprite();
	sushi->m_row = row;
	sushi->m_col = col;
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) 
	srand(rand() + GetTickCount());
#else
	srand(rand() + 1199);
#endif
    sushi->m_imgIndex = rand() % TOTAL_SUSHI;
    sushi->initWithSpriteFrameName(sushiNormal[sushi->m_imgIndex]);
	sushi->autorelease();
	return sushi;
}