bool SimonSays::frameEnded(const Ogre::FrameEvent &evt) { bool ret = BaseApplication::frameEnded(evt); //if ( showMode ) { // if its in show mode, activate the spots according to the order in simonOrder simonTimer += evt.timeSinceLastFrame; // returns time in seconds if( pause && simonTimer > 0.5 ) { mSceneMgr->getLight("yellowSpot")->setVisible( false ); mSceneMgr->getLight("redSpot")->setVisible( false ); mSceneMgr->getLight("blueSpot")->setVisible( false ); mSceneMgr->getLight("greenSpot")->setVisible( false ); simonTimer = 0; pause = false; } if( !pause && simonTimer > 1 ) { simonTimer = 0; if( simonCounter < simonOrder.size() ) { // as long as there's stuff in the vector there's still spots to light up turnOnSpot( simonOrder.at(simonCounter) ); playerOrder.push_back( simonOrder.at(simonCounter) ); //simonOrder.erase( simonOrder.begin()); simonCounter++; pause = true; } else { // die Spieler-Runde starten setShowMode(false); } } // eof simonTimer > x //} if( turnEnded ) { setShowMode(true); // this turns off all the lights and stuff } return ret; }
ExtManager::ExtManager() : Manager(7) { setShowMode(NeverShow); setShowStatistics(true); setShowDrawGamesStatistic(true); const uint RANGE[6] = { 0, 32, 40, 48, 56, 64 }; QVector<uint> s; s.resize(6); qCopy(RANGE, RANGE + 6, s.begin()); setScoreHistogram(s, ScoreBound); QList< const KgDifficultyLevel * > diffList = Kg::difficulty()->levels(); for (int i = 0; i < diffList.size(); i++) m_typeLabels << diffList.at(i)->title(); }
StationInfoWidget::StationInfoWidget(MetroMapMainWindow* ctrl, QWidget* parent) : QWidget(parent), m_ui(new Ui::StationInfoWidget()), m_controller(ctrl), m_lockMode(true), m_currentStation(0) { Q_CHECK_PTR(m_controller); m_ui->setupUi(this); initLineColors(); setShowMode(); connect(m_controller, SIGNAL(mapChanged()), SLOT(slotMapChanged())); connect(m_ui->lockButton, SIGNAL(clicked()), SLOT(slotChangeMode())); connect(m_ui->addNextButton, SIGNAL(clicked()), SLOT(slotAddNextStation())); connect(m_ui->addCrossButton, SIGNAL(clicked()), SLOT(slotAddCrossStation())); }
void SimonSays::restartGame( bool restart ) { mSceneMgr->setAmbientLight(Ogre::ColourValue(0.3,0.3,0.3)); // restart is true if the game is set up anew (e.g. first turn or the player made a mistake) if( restart ) { if( simonOrder.size() > 0 ) simonOrder.clear(); getNewOrder( S_LENGTH ); // only needs to set once!! //simonLength = 4; //simonExtension = 1; } else { // otherwise add 2 spots to simonOrder! getNewOrder( S_EXTENSION ); // add new spots to the order //mSceneMgr->setAmbientLight(Ogre::ColourValue(0.3,0.3,1)); } //mSceneMgr->setAmbientLight(Ogre::ColourValue(0.3,0.3,0.3)); setShowMode(true); simonCounter = 0; simonTimer = 0; turnEnded = false; correctOrder = true; // set order to correct again playerOrder.clear(); }