Beispiel #1
0
void MainMenu::onKeyDown(KeyboardEvent* event)
{
    switch (event->keyCode())
    {
        case SDLK_e:
        case SDLK_ESCAPE:
            doExit();
            break;
        case SDLK_n:
            doNewGame();
            break;
        case SDLK_l:
            doLoadGame();
            break;
        case SDLK_i:
            doIntro();
            break;
        case SDLK_c:
            doCredits();
            break;
        case SDLK_o:
            doSettings();
            break;
    }
}
/** Reset many game state variables */
void Micropolis::initWillStuff()
{
    randomlySeedRandom();
    initGraphMax();
    destroyAllSprites();

    roadEffect = MAX_ROAD_EFFECT;
    policeEffect = MAX_POLICE_STATION_EFFECT;
    fireEffect = MAX_FIRE_STATION_EFFECT;
    cityScore = 500;
    cityPop = -1;
    cityTimeLast = -1;
    cityYearLast = -1;
    cityMonthLast = -1;
    totalFundsLast = -1;
    resLast = comLast = indLast = -999999;
    roadFund = 0;
    policeFund = 0;
    fireFund = 0;
    valveFlag = true;
    disasterEvent = SC_NONE;
    taxFlag = false;

    populationDensityMap.clear();
    trafficDensityMap.clear();
    pollutionDensityMap.clear();
    landValueMap.clear();
    crimeRateMap.clear();
    terrainDensityMap.clear();
    rateOfGrowthMap.clear();
    comRateMap.clear();
    policeStationMap.clear();
    policeStationEffectMap.clear();
    fireStationMap.clear();
    fireStationEffectMap.clear();

    doNewGame();
    doUpdateHeads();
}
Beispiel #3
0
void MainMenu::onNewGameButtonClick(MouseEvent* event)
{
    doNewGame();
}