Time for action – adding the final screen sprites
The last sprites we need to create are the clouds, the bomb and shockwave, and our game state messages.
Back to the
createGameScreen
method, add the clouds to the screen:for (int i = 0; i < 4; i++) { float cloud_y = i % 2 == 0 ? _screenSize.height * 0.4f : _screenSize.height * 0.5f; auto cloud = Sprite::createWithSpriteFrameName("cloud.png"); cloud->setPosition(Vec2 (_screenSize.width * 0.1f + i * _screenSize.width * 0.3f, cloud_y)); _gameBatchNode->addChild(cloud, kBackground); _clouds.pushBack(cloud); }
Create the
_bomb
sprite; players will grow when tapping the screen:_bomb = Sprite::createWithSpriteFrameName("bomb.png"); _bomb->getTexture()->generateMipmap(); _bomb->setVisible(false); auto size = _bomb->getContentSize(); //add sparkle inside bomb sprite auto sparkle = Sprite::createWithSpriteFrameName("sparkle.png"); sparkle->setPosition(Vec2(size.width * 0.72f, size.height * 0.72f)); _bomb->addChild...