Lottery* Lottery::createLottery(int numbers, int width, int height, float CardSpriteX, float CardSpriteY) { Lottery* lotteryInstance = new Lottery(); if (lotteryInstance && lotteryInstance->init()) { lotteryInstance->autorelease(); lotteryInstance->lotteryInit(numbers, width, height, CardSpriteX, CardSpriteY); return lotteryInstance; } CC_SAFE_DELETE(lotteryInstance); return NULL; }