Game Development Reference
In-Depth Information
_star->resetSystem();
}
3. And finally, our resetGame method:
void GameLayer::resetGame () {
_rocket->setPosition(Vec2(_screenSize.width *
0.5f, _screenSize.height * 0.1f));
_rocket->setOpacity(255);
_rocket->setVisible(true);
_rocket->reset();
_cometInterval = 4;
_cometTimer = 0;
_timeBetweenPickups = 0.0;
_score = 0;
_scoreDisplay->setString(String::createWithFormat("%i",
_score)->getCString());
_lineContainer->reset();
//shuffle grid cells
std::random_shuffle(_grid.begin(), _grid.end());
_gridIndex = 0;
resetStar();
_warp->stopSystem();
_running = true;
SimpleAudioEngine::getInstance()->playBackgroundMusic("background.mp3",
true);
Search WWH ::




Custom Search