| 70 | } |
| 71 | |
| 72 | void PlayLayer::showCompleteText() |
| 73 | { |
| 74 | m_bEndAnimation = true; |
| 75 | |
| 76 | auto size = Director::getInstance()->getWinSize(); |
| 77 | |
| 78 | float scale = 1.1f; |
| 79 | const char* spr = "GJ_levelComplete_001.png"; |
| 80 | /*if (m_isPracticeMode) { |
| 81 | spr = "GJ_practiceComplete_001.png"; |
| 82 | scale = 1; |
| 83 | }*/ |
| 84 | |
| 85 | auto sprite = Sprite::createWithSpriteFrameName(spr); |
| 86 | sprite->setScale(0.01f); |
| 87 | sprite->setPosition({size.width / 2, size.height / 2 + 35}); |
| 88 | m_pHudLayer->addChild(sprite); |
| 89 | |
| 90 | sprite->runAction(Sequence::create(EaseElasticOut::create(ScaleTo::create(0.66f, scale), 0.6), |
| 91 | DelayTime::create(0.88f), EaseIn::create(ScaleTo::create(0.22f, 0), 2.0f), |
| 92 | RemoveSelf::create(true), nullptr)); |
| 93 | |
| 94 | auto col1 = _player1->getMainColor(); |
| 95 | auto col2 = _player1->getSecondaryColor(); |
| 96 | |
| 97 | auto par1 = ParticleSystemQuad::create("levelComplete01.plist"); |
| 98 | par1->setPosition(sprite->getPosition()); |
| 99 | par1->setStartColor({(GLfloat)col1.r, (GLfloat)col1.g, (GLfloat)col1.b, 255}); |
| 100 | par1->setEndColor({(GLfloat)col1.r, (GLfloat)col1.g, (GLfloat)col1.b, 0}); |
| 101 | m_pHudLayer->addChild(par1, -1); |
| 102 | |
| 103 | auto par2 = ParticleSystemQuad::create("levelComplete01.plist"); |
| 104 | par2->setPosition(par1->getPosition()); |
| 105 | par2->setStartColor({(GLfloat)col2.r, (GLfloat)col2.g, (GLfloat)col2.b, 255}); |
| 106 | par2->setEndColor({(GLfloat)col2.r, (GLfloat)col2.g, (GLfloat)col2.b, 0}); |
| 107 | m_pHudLayer->addChild(par2, -1); |
| 108 | |
| 109 | auto cir = CircleWave::create(0.8f, {col1.r, col1.g, col1.b, 255}, 5.f, size.width - 10, true, false); |
| 110 | cir->setPosition({size.width - 10, size.height / 2}); |
| 111 | m_pHudLayer->addChild(cir, -1); |
| 112 | |
| 113 | auto cir2 = CircleWave::create(0.8f, {col1.r, col1.g, col1.b, 255}, 5.f, 250.0f, true, false); |
| 114 | cir2->setPosition(sprite->getPosition()); |
| 115 | m_pHudLayer->addChild(cir2, -1); |
| 116 | |
| 117 | // for (int i = 0; i < 9; i++) |
| 118 | // m_pHudLayer->runAction(Sequence::createWithTwoActions( |
| 119 | // DelayTime::create(0.16f * i), CallFunc::create([&]() { PlayLayer::spawnCircle(); }))); |
| 120 | |
| 121 | // m_pHudLayer->runAction( |
| 122 | // Sequence::createWithTwoActions(DelayTime::create(1.5f), CallFunc::create([&]() { PlayLayer::showEndLayer(); |
| 123 | // }))); |
| 124 | for (int i = 0; i < 9; i++) |
| 125 | { |
| 126 | scheduleOnce([&](float d) { spawnCircle(); }, 0.16f * i, "playlayer_circles"); |
| 127 | } |
| 128 | scheduleOnce([&](float d) { showEndLayer(); }, 1.5f, "playlayer_levelend"); |
| 129 | } |
no test coverage detected