Game Development Reference
In-Depth Information
halo->setPosition(Vec2(size.width * 0.4f, size.height
* 0.4f));
_bomb->addChild(halo, kMiddleground, kSpriteHalo);
_gameBatchNode->addChild(_bomb, kForeground);
3. Then create the _shockwave sprite that appears after the _bomb goes off:
_shockWave =
Sprite::createWithSpriteFrameName("shockwave.png");
_shockWave->getTexture()->generateMipmap();
_shockWave->setVisible(false);
_gameBatchNode->addChild(_shockWave);
4. Finally, add the two messages that appear on the screen, one for our intro state
and one for our gameover state:
_introMessage =
Sprite::createWithSpriteFrameName("logo.png");
_introMessage->setPosition(Vec2 (_screenSize.width *
0.5f, _screenSize.height * 0.6f));
_introMessage->setVisible(true);
this->addChild(_introMessage, kForeground);
_gameOverMessage = Sprite::createWithSpriteFrameName
("gameover.png");
_gameOverMessage->setPosition(Vec2 (_screenSize.width
* 0.5f, _screenSize.height * 0.65f));
_gameOverMessage->setVisible(false);
this->addChild(_gameOverMessage, kForeground);
Search WWH ::




Custom Search