//-------------------------------------------------------------- void planetEtchApp::setup(){ capture = false; numCities = 0; cities = NULL; displayMode = DISPLAY_MODE_POPULATION; #ifdef FILTER_CSV filterCSV(); #endif initCities(); initCarbonEmissions(); }
void Game::init(sf::RenderWindow* window, Settings* settings) { this->settings = settings; this->window = window; backgroundColor = sf::Color(0, 0, 0); isGameOver = false; currentLevel = 0; nrOfMeteorsLeftTilNextLevel = 0; initGround(); initMissileBase(); initCities(); initProjectileParameters(); score = Score(settings, sf::Vector2f(5, 5), sf::Color::White); }
void Game::newGame() { //clean up existing data //clear city data for(int i = int(cities.size()-1); i >= 0; i--) { delete cities[i]; cities.erase( cities.begin() + i); } //start random seed seed = time(NULL); srand( seed); //init cities initCities(); mainLoop(); }