void HelloWorld::endScene(EndReason endReason) { if (_gameOver) return; _gameOver = true; //存储分数 setHighestHistorySorce(); gScore = 0; auto winSize = Director::getInstance()->getWinSize(); char message[10] = "You Win"; if (endReason == KENDREASONLOSE) strcpy(message, "You Lose"); LabelBMFont * label; label = LabelBMFont::create(message,"fonts/Arial.fnt"); label->setScale(0.1); label->setPosition(Point(winSize.width / 2, winSize.height*0.6)); this->addChild(label); LabelBMFont * restartLabel; restartLabel = LabelBMFont::create("Restart", "fonts/Arial.fnt"); auto *restartItem = MenuItemLabel::create(restartLabel,CC_CALLBACK_1(HelloWorld::restartTapped,this)); restartItem->setScale(0.1); restartItem->setPosition(Point(winSize.width / 2, winSize.height*0.4)); Menu *menu = Menu::create(restartItem, NULL); menu->setPosition(Point::ZERO); this->addChild(menu); // clear label and menu restartItem->runAction(ScaleTo::create(0.5, 1.0)); label->runAction(ScaleTo::create(0.5, 1.0)); // Terminate update callback this->unscheduleUpdate(); }
void HelloWorld::showRestartMenu() { Size winSize = Director::getInstance()->getWinSize(); const char *message; if (_won) { message = "You win!"; } else { message = "You lose!"; } LabelBMFont *label = LabelBMFont::create(message, "Arial.fnt"); label->setScale(0.1f); label->setPosition(winSize.width / 2, winSize.height * 0.6f); this->addChild(label); LabelBMFont *restartLabel = LabelBMFont::create("Restart", "Arial.fnt"); MenuItemLabel *restartItem = MenuItemLabel::create(restartLabel, [](Object *sender){ Director::getInstance()->replaceScene(TransitionZoomFlipX::create(0.5f, HelloWorld::createScene())); }); restartItem->setScale(0.1f); restartItem->setPosition(winSize.width / 2, winSize.height * 0.4f); Menu *menu = Menu::createWithItem(restartItem); menu->setPosition(Point::ZERO); this->addChild(menu); restartItem->runAction(ScaleTo::create(0.5f, 1.0f)); label->runAction(ScaleTo::create(0.5f, 1.0f)); }
void LeaderBoardAdvanceModeNode::addItemToSlide(const int& iStage, const char* sName, const char* sFacebookId, const int& iRank) { Node* pNodeItem = Node::create(); Sprite* pLoadAvatar = Sprite::create("Target-End-Game/border_avatar.png"); pLoadAvatar->setPosition(Point(55.0f, 65.0f)); pNodeItem->addChild(pLoadAvatar); std::string urlAvatar = "https://graph.facebook.com/"; urlAvatar.append(sFacebookId); urlAvatar.append("/picture"); LoadingImagetNode* avatar = LoadingImagetNode::createLayout(urlAvatar.c_str()); avatar->setPosition(Point(56.0f, 65.0f)); pNodeItem->addChild(avatar); LabelTTF *pLabelName = LabelTTF::create(sName, "Arial", 20.0f); pLabelName->setColor(ccc3(0.0f, 0.0f, 0.0f)); //pLabelName->setScale(0.80f); pLabelName->setAnchorPoint(Point(0.0f, 0.5f)); pLabelName->setPosition(Point(26.0f, 17.0f)); pNodeItem->addChild(pLabelName); char sStage[5]; sprintf(sStage, "%d", iStage); LabelBMFont *pLabelNumberStage = LabelBMFont::create(sStage, "fonts/font-bechic.fnt"); pLabelNumberStage->setAnchorPoint(Point(0.5f, 0.5f)); pLabelNumberStage->setPosition(Point(130.0f, 85.0f)); pLabelNumberStage->setScale(0.90); pNodeItem->addChild(pLabelNumberStage); LabelBMFont *pLabelStage = LabelBMFont::create("Stage", "fonts/font_small_alert.fnt"); pLabelStage->setAnchorPoint(Point(0.5f, 0.5f)); pLabelStage->setPosition(Point(130.0f, 50.0f)); pLabelStage->setScale(0.8f); pNodeItem->addChild(pLabelStage); Sprite* pLineImage = Sprite::create("Target-End-Game/line.png"); pLineImage->setPosition(Point(160.0f, 55.0f)); pNodeItem->addChild(pLineImage); pNodeItem->setContentSize(Size(160.0f, 160.0f)); pNodeItem->setPosition(Point(-320.0f + (iRank-1)*160, -100.0f)); m_pSlideShow->addChild(pNodeItem); }
void LeaderBoardtNode::addItemToSlide(const int& iScore, const char* sName, const char* sFacebookId, const int& iRank, const int& iIndex) { Node* pNodeItem = Node::create(); Sprite* pLoadAvatar = Sprite::create("Target-End-Game/border_avatar.png"); pLoadAvatar->setPosition(Point(50.0f, 95.0f)); pNodeItem->addChild(pLoadAvatar); std::string urlAvatar = "https://graph.facebook.com/"; urlAvatar.append(sFacebookId); urlAvatar.append("/picture"); LoadingImagetNode* avatar = LoadingImagetNode::createLayout(urlAvatar.c_str()); avatar->setPosition(Point(50.0f, 95.0f)); pNodeItem->addChild(avatar); LabelBMFont *pLabelScore = LabelBMFont::create(formatNumber(iScore).getCString(), "fonts/font_small_alert.fnt"); pLabelScore->setAnchorPoint(Point(0.0f, 0.5f)); pLabelScore->setPosition(Point(57.0f, 8.0f)); pLabelScore->setScale(0.8); pNodeItem->addChild(pLabelScore); LabelTTF *pLabelName = LabelTTF::create(sName, "Arial", 20.0f); pLabelName->setColor(ccc3(0.0f, 0.0f, 0.0f)); //pLabelName->setScale(0.85f); pLabelName->setAnchorPoint(Point(0.0f, 0.5f)); pLabelName->setPosition(Point(57.0f, 45.0f)); pNodeItem->addChild(pLabelName); char sRank[10]; sprintf(sRank, "%d", iRank); LabelBMFont *pLabelRank = LabelBMFont::create(sRank, "fonts/font-bechic.fnt"); pLabelRank->setAnchorPoint(Point(0.0f, 0.5f)); pLabelRank->setPosition(Point(25.0f, 23.0f)); pNodeItem->addChild(pLabelRank); Sprite* pLineImage = Sprite::create("Target-End-Game/line.png"); pLineImage->setPosition(Point(160.0f, 55.0f)); pNodeItem->addChild(pLineImage); pNodeItem->setContentSize(Size(160.0f, 160.0f)); pNodeItem->setPosition(Point(-320.0f + iIndex*160, -100.0f)); pNodeItem->setTag(iIndex); m_pSlideShow->addChild(pNodeItem); Sprite* pIconAskLife = Sprite::create("Target-End-Game/btn_ask_life.png"); ButtonNode* pButtonAskLife = ButtonNode::createButtonSprite(pIconAskLife, CC_CALLBACK_1(LeaderBoardtNode::clickAskLife, this)); pButtonAskLife->setPosition(Point(-205.0f + iIndex*160, -5.0f)); m_pButtonManagerNode->addButtonNode(pButtonAskLife); }
BallSprite* BallSprite::createWithNumber(kBallNumber number) { BallSprite *ballSprite = new BallSprite(); ballSprite->setNumber(number); if(ballSprite && ballSprite->initWithFile(PNG_BALL)) { //ボールの数字をラベルとして付ける const char* numberString = CCString::createWithFormat("%d", number)->getCString(); LabelBMFont* numberLabel = CCLabelBMFont::create(numberString, FONT_NUMBER); numberLabel->setPosition(Point(ballSprite->getContentSize().width / 2,ballSprite->getContentSize().height / 2)); numberLabel->setScale(1.8); ballSprite->addChild(numberLabel, kZOrderNumber, kTagNumber); //ボールのメモリを自動消去 ballSprite->autorelease(); //作ったSpriteを返す return ballSprite; } else { CC_SAFE_DELETE(ballSprite); return nullptr; } }
bool EndGameCustomModeNode::init() { if (!Node::init()) { return false; } Sprite* pBackground = Sprite::create("AdvanceMode/background.png"); pBackground->setPosition(Point(320.0f, 485.0f)); this->addChild(pBackground); auto listener = EventListenerTouch::create(Touch::DispatchMode::ONE_BY_ONE); listener->setSwallowTouches(true); listener->onTouchBegan = [this](Touch* touch, Event* event) { return true; }; EventDispatcher::getInstance()->addEventListenerWithSceneGraphPriority(listener, pBackground); Sprite* pBackgroundPopUp = Sprite::create("AdvanceMode/panel-AM-short.png"); pBackgroundPopUp->setPosition(Point(320.0f, 595.0f)); this->addChild(pBackgroundPopUp); LabelBMFont *pLabelTitle = LabelBMFont::create("ADVANCE MODE", "fonts/font-bechic.fnt"); pLabelTitle->setAnchorPoint(Point(0.5f, 0.5f)); pLabelTitle->setPosition(Point(320.0f, 872.0f)); this->addChild(pLabelTitle); Sprite* pPanel = Sprite::create("AdvanceMode/panel-target-end-game.png"); pPanel->setPosition(Point(320.0f, 550.0f)); this->addChild(pPanel); /* Sprite* pIconEye1 = Sprite::create("AdvanceMode/eye-icon.png"); pIconEye1->setPosition(Point(500.0f, 550.0f)); this->addChild(pIconEye1); Sprite* pIconEye2 = Sprite::create("AdvanceMode/eye-icon.png"); pIconEye2->setPosition(Point(500.0f, 480.0f)); this->addChild(pIconEye2); */ m_csPackageInfo = CSPackageTable::getCSPackageInfo(m_sPackageId); if (m_csPackageInfo.iStage < m_iStage && m_iStage > 1) { Sprite* pNewRecord = Sprite::create("AdvanceMode/new-record.png"); pNewRecord->setPosition(Point(548.0f, 668.0f)); this->addChild(pNewRecord); m_csPackageInfo.iStage = m_iStage; } else if (m_csPackageInfo.iStage == 0) { m_csPackageInfo.iStage = m_iStage; } LabelBMFont *pLabelpackageName = LabelBMFont::create(m_csPackageInfo.sPackageName.c_str(), "fonts/font_title-popup.fnt"); pLabelpackageName->setAnchorPoint(Point(0.5f, 0.5f)); pLabelpackageName->setPosition(Point(320.0f, 780.0f)); this->addChild(pLabelpackageName); LabelTTF* pLabelTCreatedBy = LabelTTF::create(m_csPackageInfo.sCreatedBy.c_str(), "Arial", 28); pLabelTCreatedBy->setColor(ccc3(255.0f, 255.0f, 255.0f)); pLabelTCreatedBy->setPosition(Point(320.0f, 720.0f)); this->addChild(pLabelTCreatedBy); char sStage[20]; sprintf(sStage, "Stage %d", m_csPackageInfo.iStage); LabelBMFont *pLabelStage = LabelBMFont::create(sStage, "fonts/font_score.fnt", 310.0f); pLabelStage->setPosition(Point(320.0f, 630)); pLabelStage->setScale(1.4); this->addChild(pLabelStage); LabelBMFont *pLabelTotalWord = LabelBMFont::create("Total Words", "fonts/font_small_alert.fnt", 310.0f); pLabelTotalWord->setAnchorPoint(Point(0.0f, 0.5f)); pLabelTotalWord->setPosition(Point(122.0f, 550)); this->addChild(pLabelTotalWord); char sTotalWord[20]; sprintf(sTotalWord, "%d/%d", m_csPackageInfo.iTotalWordUnlock, m_csPackageInfo.iTotalWord); LabelBMFont *pLabelNumberTotalWord = LabelBMFont::create(sTotalWord, "fonts/font_score.fnt"); pLabelNumberTotalWord->setAnchorPoint(Point(1.0f, 0.5f)); pLabelNumberTotalWord->setPosition(Point(475.0f, 550)); pLabelNumberTotalWord->setScale(1.2); this->addChild(pLabelNumberTotalWord); LabelBMFont *pLabelWordNew = LabelBMFont::create("New words", "fonts/font_small_alert.fnt", 310.0f); pLabelWordNew->setAnchorPoint(Point(0.0f, 0.5f)); pLabelWordNew->setPosition(Point(122.0f, 480)); this->addChild(pLabelWordNew); char sTotalWordNew[10]; sprintf(sTotalWordNew, "%d", m_iWordNew); LabelBMFont *pLabelNumberWordNew = LabelBMFont::create(sTotalWordNew, "fonts/font_score.fnt"); pLabelNumberWordNew->setAnchorPoint(Point(1.0f, 0.5f)); pLabelNumberWordNew->setPosition(Point(475.0f, 480)); pLabelNumberWordNew->setScale(1.2); this->addChild(pLabelNumberWordNew); ButtonManagerNode* pButtonManagerNode = ButtonManagerNode::create(); this->addChild(pButtonManagerNode); Sprite* m_pButtonPlayImage = Sprite::create("AdvanceMode/btn_replay.png"); ButtonNode* pButtonPlay = ButtonNode::createButtonSprite(m_pButtonPlayImage, CC_CALLBACK_1(EndGameCustomModeNode::clickRetry, this)); pButtonPlay->setPosition(Point(320.0f, 345.0f)); pButtonManagerNode->addButtonNode(pButtonPlay); Sprite* m_pButtonCloseImage = Sprite::create("AdvanceMode/btn_close.png"); ButtonNode* pButtonClose = ButtonNode::createButtonSprite(m_pButtonCloseImage, CC_CALLBACK_1(EndGameCustomModeNode::clickClose, this)); pButtonClose->setPosition(Point(580.0f, 898.0f)); pButtonManagerNode->addButtonNode(pButtonClose); LeaderBoardAdvanceModeNode* pLeaderBoard = LeaderBoardAdvanceModeNode::createLayout(m_sPackageId); pLeaderBoard->setPosition(Point(320.0f, 114.0f)); this->addChild(pLeaderBoard); return true; }
bool EndGameNode::initWin() { if (!Node::init()) { return false; } LevelConfig* pLevelConfig = &GameConfigManager::getInstance()->GetLevelConfig(m_sChapterId, m_iCurrentLevel); m_iTotalBonusQuest = pLevelConfig->m_BonusQuestConfig.m_iBonusQuestCount; LayerColor* pBackground = LayerColor::create(ccc4(7, 25, 44, 150)); pBackground->setContentSize(CCSizeMake(640.0f, 960.0f)); auto listener = EventListenerTouch::create(Touch::DispatchMode::ONE_BY_ONE); listener->setSwallowTouches(true); listener->onTouchBegan = [](Touch* touch, Event* event) { return true; }; EventDispatcher::getInstance()->addEventListenerWithSceneGraphPriority(listener, pBackground); this->addChild(pBackground); this->setContentSize(pBackground->getContentSize()); //m_pSpriteBatchNode = SpriteBatchNode::create("Target-End-Game/TargetEndgame.pvr.ccz"); //SpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile("Target-End-Game/TargetEndgame.plist"); //this->addChild(m_pSpriteBatchNode); Sprite* pBackgroundBoard = Sprite::create("Target-End-Game/panel-level_popup.png"); pBackgroundBoard->setPosition(Point(320.0f, 610.0f)); this->addChild(pBackgroundBoard); m_pStarAndBonusQuestNode = Node::create(); this->addChild(m_pStarAndBonusQuestNode); this->generateLayoutStartAndBonusQuest(); Sprite* pCompletedImage = Sprite::create("Target-End-Game/text_level_completed.png"); pCompletedImage->setPosition(Point(320.0f, 654.0f)); this->addChild(pCompletedImage); FlashCardNode* pFlashCard = FlashCardNode::createLayout(m_mainWord); pFlashCard->setPosition(70.0f, 200.0f); pFlashCard->setScale(0.52f); this->addChild(pFlashCard); char sLevel[20]; int iCalLevel = GameConfigManager::getInstance()->CountLevelOfPreviousChapters(m_sChapterId); sprintf(sLevel, "Level %d", m_iCurrentLevel + iCalLevel); LabelBMFont *pLabelLevel = LabelBMFont::create(sLevel, "fonts/font-bechic.fnt"); pLabelLevel->setAnchorPoint(Point(0.5f, 0.5f)); pLabelLevel->setPosition(Point(320.0f, 870.0f)); this->addChild(pLabelLevel); LabelBMFont *pLabelScore = LabelBMFont::create("SCORE:", "fonts/font_score.fnt"); pLabelScore->setAnchorPoint(Point(0.5f, 0.5f)); pLabelScore->setPosition(Point(474.0f, 525.0f)); this->addChild(pLabelScore); LabelBMFont *pLabelNumScore = LabelBMFont::create(formatNumber(m_iScore).getCString(), "fonts/font_score.fnt"); pLabelNumScore->setAnchorPoint(Point(0.5f, 0.5f)); pLabelNumScore->setPosition(Point(474.0f, 480.0f)); pLabelNumScore->setScale(1.4f); this->addChild(pLabelNumScore); Sprite* pButtonNextGameSprite = Sprite::create("Target-End-Game/btn_next.png"); ButtonNode* buttonNextNode = ButtonNode::createButtonSprite(pButtonNextGameSprite, CC_CALLBACK_1(EndGameNode::menuNextLevelCallBack, this)); buttonNextNode->setPosition(Point(425.0f, 279.0f)); Sprite* pButtonReplayGameSprite = Sprite::create("Target-End-Game/btn_replay.png"); ButtonNode* buttonReplayNode = ButtonNode::createButtonSprite(pButtonReplayGameSprite, CC_CALLBACK_1(EndGameNode::menuRetryLevelWinCallBack, this)); buttonReplayNode->setPosition(Point(225.0f, 279.0f)); Sprite* pButtonCloseSprite = Sprite::create("Target-End-Game/btn_close.png"); ButtonNode* buttonCloseNode = ButtonNode::createButtonSprite(pButtonCloseSprite, CC_CALLBACK_1(EndGameNode::menuCloseWinCallBack, this)); buttonCloseNode->setPosition(Point(572.0f, 894.0f)); ButtonManagerNode* pButtonManagerNode = ButtonManagerNode::create(); pButtonManagerNode->addButtonNode(buttonNextNode); pButtonManagerNode->addButtonNode(buttonCloseNode); pButtonManagerNode->addButtonNode(buttonReplayNode); this->addChild(pButtonManagerNode); m_levelInfo = LevelTable::getInstance()->getLevel(m_sChapterId, m_iCurrentLevel); m_chapterInfo = ChapterTable::getInstance()->getChapterInfo(m_sChapterId); if (m_levelInfo.bIsUnlock == false) { m_chapterInfo.iTotalLevelUnlock++; UserInfo userInfo = UserTable::getInstance()->getUserInfo(); userInfo.sCurrentChapterId = m_levelInfo.sChapterId; userInfo.iCurrentLevel = m_levelInfo.iLevel + 1; // Unlock chapter WordlMapConfig worldMapConfig = GameConfigManager::getInstance()->GetWordlMapConfig(); int iIndexCurrentChapter = worldMapConfig.m_WorlMapChapterConfigMap[m_levelInfo.sChapterId]; WordlMapConfig::WordMapChapterConfig worldMapChapterConfig = worldMapConfig.m_WorlMapChapterConfigs[iIndexCurrentChapter]; if (m_iCurrentLevel >= worldMapChapterConfig.m_iTotalevel) { //userInfo.iCurrentLevel = worldMapChapterConfig.m_iTotalevel; // Create data for new chapter std::string sNextChapterID; if ( GameConfigManager::getInstance()->GetNextChapterID(worldMapChapterConfig.m_sChapterId, sNextChapterID)) { InitDatabase::getInstance()->createDataChapterAndLevel(sNextChapterID); userInfo.sCurrentChapterId = sNextChapterID; userInfo.iCurrentLevel = 1; UserDefault::getInstance()->setStringForKey("ChapterPlayGame", userInfo.sCurrentChapterId); } else // the last chapter is finished so game is end now!!!! { } } UserTable::getInstance()->updateUser(userInfo); } m_levelInfo.bIsUnlock = true; m_levelInfo.iTotalBonusQuest = m_iTotalBonusQuest; if (m_levelInfo.iScore < m_iScore) { m_levelInfo.iScore = m_iScore; } if(m_levelInfo.iBonusQuest < m_iBonusQuestCompleted) { m_levelInfo.iBonusQuest = m_iBonusQuestCompleted; } if(m_levelInfo.iStar < m_iYellowStar) { m_chapterInfo.iTotalStar += m_iYellowStar - m_levelInfo.iStar; m_levelInfo.iStar = m_iYellowStar; } // Update Word for chapter const std::string sWordId = GameWordManager::getInstance()->GetWordIdFromWord(m_mainWord); WordInfo wordInfo = WordTable::getInstance()->getWordInfoOnChapter(m_levelInfo.sChapterId, sWordId); wordInfo.iCountCollected++; LevelTable::getInstance()->updateLevel(m_levelInfo); WordTable::getInstance()->updateWord(wordInfo); ChapterTable::getInstance()->updateChapter(m_chapterInfo); m_iCountYellowStar = 0; m_iCountBonusQuest = 0; this->sequenceUpdateStar(); LeaderBoardtNode* pLeaderBoard = LeaderBoardtNode::createLayout(m_iCurrentLevel, m_sChapterId); pLeaderBoard->setPosition(Point(320.0f, 114.0f)); this->addChild(pLeaderBoard); auto actionupdateDatabaseAndSync = CallFunc::create(this, callfunc_selector(EndGameNode::updateDatabaseAndSync)); this->runAction(Sequence::create(DelayTime::create(0.01f), actionupdateDatabaseAndSync, NULL)); return true; }
bool EndGameNode::initLose() { if (!Node::init()) { return false; } LayerColor* pBackground = LayerColor::create(ccc4(7, 25, 44, 150)); pBackground->setContentSize(CCSizeMake(640.0f, 960.0f)); auto listener = EventListenerTouch::create(Touch::DispatchMode::ONE_BY_ONE); listener->setSwallowTouches(true); listener->onTouchBegan = [](Touch* touch, Event* event) { return true; }; EventDispatcher::getInstance()->addEventListenerWithSceneGraphPriority(listener, pBackground); this->addChild(pBackground); this->setContentSize(pBackground->getContentSize()); //m_pSpriteBatchNode = SpriteBatchNode::create("Target-End-Game/TargetEndgame.pvr.ccz"); //SpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile("Target-End-Game/TargetEndgame.plist"); //this->addChild(m_pSpriteBatchNode); Sprite* pBackgroundBoard = Sprite::create("Target-End-Game/panel-level_popup.png"); pBackgroundBoard->setPosition(Point(320.0f, 610.0f)); this->addChild(pBackgroundBoard); Sprite* pLevelFailImage3 = Sprite::create("Target-End-Game/text_level_fail.png"); pLevelFailImage3->setPosition(Point(320.0f, 750.0f)); this->addChild(pLevelFailImage3); Sprite* pIconBoosterLock1 = Sprite::create("Target-End-Game/lock-icon-powerup.png"); pIconBoosterLock1->setPosition(Point(220.0f, 415.0f)); this->addChild(pIconBoosterLock1); Sprite* pIconBoosterLock2 = Sprite::create("Target-End-Game/lock-icon-powerup.png"); pIconBoosterLock2->setPosition(Point(320.0f, 415.0f)); this->addChild(pIconBoosterLock2); Sprite* pIconBoosterLock3 = Sprite::create("Target-End-Game/lock-icon-powerup.png"); pIconBoosterLock3->setPosition(Point(420.0f, 415.0f)); this->addChild(pIconBoosterLock3); FlashCardNode* pFlashCard = FlashCardNode::createLayout(m_mainWord); pFlashCard->setPosition(70.0f, 285.0f); pFlashCard->setScale(0.52f); this->addChild(pFlashCard); char sLevel[20]; int iCalLevel = GameConfigManager::getInstance()->CountLevelOfPreviousChapters(m_sChapterId); sprintf(sLevel, "Level %d", m_iCurrentLevel + iCalLevel); LabelBMFont *pLabelLevel = LabelBMFont::create(sLevel, "fonts/font-bechic.fnt"); pLabelLevel->setAnchorPoint(Point(0.5f, 0.5f)); pLabelLevel->setPosition(Point(320.0f, 870.0f)); this->addChild(pLabelLevel); LabelBMFont *pLabelScore = LabelBMFont::create("SCORE:", "fonts/font_score.fnt"); pLabelScore->setAnchorPoint(Point(0.5f, 0.5f)); pLabelScore->setPosition(Point(474.0f, 630.0f)); this->addChild(pLabelScore); LabelBMFont *pLabelNumScore = LabelBMFont::create(formatNumber(m_iScore).getCString(), "fonts/font_score.fnt"); pLabelNumScore->setAnchorPoint(Point(0.5f, 0.5f)); pLabelNumScore->setPosition(Point(474.0f, 585.0f)); pLabelNumScore->setScale(1.4f); this->addChild(pLabelNumScore); LeaderBoardtNode* pLeaderBoard = LeaderBoardtNode::createLayout(m_iCurrentLevel, m_sChapterId); pLeaderBoard->setPosition(Point(320.0f, 114.0f)); this->addChild(pLeaderBoard); Sprite* pButtonPlayGameSprite = Sprite::create("Target-End-Game/btn_replay.png"); ButtonNode* buttonPlayNode = ButtonNode::createButtonSprite(pButtonPlayGameSprite, CC_CALLBACK_1(EndGameNode::menuRetryLevelLoseCallBack, this)); buttonPlayNode->setPosition(Point(320.0f, 279.0f)); Sprite* pButtonCloseSprite = Sprite::create("Target-End-Game/btn_close.png"); ButtonNode* buttonCloseNode = ButtonNode::createButtonSprite(pButtonCloseSprite, CC_CALLBACK_1(EndGameNode::menuCloseLoseCallBack, this)); buttonCloseNode->setPosition(Point(572.0f, 894.0f)); ButtonManagerNode* pButtonManagerNode = ButtonManagerNode::create(); pButtonManagerNode->addButtonNode(buttonPlayNode); pButtonManagerNode->addButtonNode(buttonCloseNode); this->addChild(pButtonManagerNode); return true; }