Esempio n. 1
0
//--------------------------------------------------------------
void planetEtchApp::setup(){
	capture = false;
    numCities = 0;
    cities = NULL;
    displayMode = DISPLAY_MODE_POPULATION;
    
#ifdef FILTER_CSV
    filterCSV();
#endif
    
    initCities();
    initCarbonEmissions();
}
Esempio n. 2
0
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);
}
Esempio n. 3
0
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();

}