您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ startGame函数代码示例

51自学网 2021-06-03 08:21:37
  C++
这篇教程C++ startGame函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中startGame函数的典型用法代码示例。如果您正苦于以下问题:C++ startGame函数的具体用法?C++ startGame怎么用?C++ startGame使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了startGame函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: Listener

/** * @brief Instanciates and starts all listeners thread (chat, online players). * @pre The client have to be connected before to call this function. */void MainWindow::startListeners(){    // Start a thread for listening server requests.    _listener = new Listener(_player.socket, this);    connect(_listener, SIGNAL(pseudoAlreadyExists(QString)), this, SLOT(pseudoAlreadyExists(QString)));    connect(_listener, SIGNAL(addMsg(QString)), this, SLOT(addMsg(QString)));    connect(_listener, SIGNAL(addPlayerToView(player)), this, SIGNAL(askAddPlayer(player)));    connect(_listener, SIGNAL(removePlayerFromView(player)), this, SIGNAL(askRmPlayer(player)));    connect(_listener,  SIGNAL(advisePlayerForGame(QString)), this, SLOT(adviseForGame(QString)));    connect(_listener, SIGNAL(advisePlayerForAbortedGame(QString)), this, SLOT(adviseForAbortedGame(QString)));    connect(_listener, SIGNAL(startGame()), this, SLOT(startGame()));    connect(_listener, SIGNAL(clientBusy(player)), ui->rightMenuWidget, SIGNAL(askSetBusy(player)));    connect(_listener, SIGNAL(clientFree(player)), ui->rightMenuWidget, SIGNAL(askSetFree(player)));    connect(_listener, SIGNAL(setOpponent(player)), this, SLOT(setOpponent(player)));    connect(_listener, SIGNAL(opponentQuit(player)), this, SLOT(opponentQuit(player)));    connect(_listener, SIGNAL(receiveCheckerboard(checkerboard)), ui->checkerboardwidget, SLOT(receiveCheckerboard(checkerboard)));    connect(_listener, SIGNAL(receiveWinner(player)), this, SLOT(displayWinner(player)));}
开发者ID:bmael,项目名称:DameGame,代码行数:30,


示例2: startGame

void GameScene::onTexturesLoaded(){    auto util = MapUtil::getInstance();    BaseLayer::onTexturesLoaded();    MapUtil::getInstance()->initMapSize();    if(isShowTip()==false)    {        startGame();    }    else    {        /* 显示提示UI */        auto wrapper = Node::create();        auto tipBg = SPRITE("default.png");        std::string tipName = util->getMapName()+".png";        auto tip = SPRITE(tipName);        wrapper->addChild(tipBg);        wrapper->addChild(tip);        wrapper->setPosition(VisibleRect::center());        addChild(wrapper);        wrapper->setScale(GameManager::getInstance()->getScaleFactor());        wrapper->runAction(Sequence::create(DelayTime::create(3.0f),CallFunc::create([&,this,wrapper]()->void{            startGame();            wrapper->removeFromParent();        }), NULL));    }           return;}
开发者ID:AIRIA,项目名称:CreazyBomber,代码行数:30,


示例3: startGame

void Game::onEnter(int param) {	gameState = 0;	char path[TXT_FIELD_WIDTH];	if (param == 0) {		if (loadFromFile(DEFAULT_LABIRYNTH_NAME)) {			startGame();		}		else {			systemModule->dialog("Nie udalo sie wczytac domyslnego labiryntu!");			systemModule->gotoLevel(&systemModule->menuLvl,0);		}	}	else {				if (systemModule->textInputDialog("Prosze podac sciezke do pliku z labiryntem do wczytania", path)){			if (loadFromFile(path)) { //sprobuj wczytac plik				startGame();			}			else {				systemModule->dialog("Nie udalo sie wczytac podanego labiryntu!");				systemModule->gotoLevel(&systemModule->menuLvl, 0);			}		}		else {			systemModule->gotoLevel(&systemModule->menuLvl, 0);		}	}}
开发者ID:Aterwik111,项目名称:PP,代码行数:27,


示例4: QGraphicsView

GameWidget::GameWidget(Scene *scene, QWidget *parent) :    QGraphicsView(parent),    m_scene(scene),    m_timeLabel(this),    m_checkpointRemainingLabel(this),    m_paused(false),    m_cameraScale(1.f),    m_frameCount(0),    m_timeBeforeStartLabel(this){    if (!scene)    {        QMessageBox::information(nullptr, "Erreur (GameWidget)", "Aucune scène a afficher!", 0);    }    else if (!scene->loaded())    {        QMessageBox::information(nullptr, "Erreur (GameWidget)", "Le niveau n'a pas été chargé!", 0);    }    else    {               this->setCursor(Qt::BlankCursor);        //Placement du label du timer        m_timeLabel.setGeometry(0,0,500,50);        m_timeLabel.setStyleSheet("color: white;font: 24pt /"Leelawadee UI/";");        //Placement du label du nombre de checkpoints restants        m_checkpointRemainingLabel.setGeometry(parent->width()-250,0,250,50);        m_checkpointRemainingLabel.setStyleSheet("color: white;font: 14pt /"Leelawadee UI/";");        //Placement du label du affichant le temps avant le début de la partie        m_timeBeforeStartLabel.setGeometry(350,250,100,100);        m_timeBeforeStartLabel.setStyleSheet("font: 72pt /"Leelawadee UI/";");        // prépare la scène pour l'affichage        this->setScene(scene->graphicsScene());        this->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);        this->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);        // réglages du clavier        grabKeyboard();        scene->setPlayerInput(&m_playerInput);        // démarrage du timer de rafraichissement du jeu        startTimer(sf::seconds(1/60.f).asMilliseconds());        //Centrage de la caméra        View view = m_scene->calcViewPoint();        centerOn(view.position());        //Démarrage du timer de début de course ( 3,2,1 -> Go)        m_preStartTimer = new PreStartTimer(this);        m_preStartTimer->startTimer();        connect(m_preStartTimer,SIGNAL(startGame()),this,SLOT(startGame()));    }}
开发者ID:DreamTeamHelha,项目名称:SirtoliRacing,代码行数:57,


示例5: startGame

void MainWindow::startGameDispatcher(){	if (sender() == m_newUntimedAct)		startGame(KDiamond::UntimedGame);	else if (sender() == m_newTimedAct)		startGame(KDiamond::NormalGame);	else		//attention: this may also be used by KgDifficulty and the ctor		startGame(Settings::untimed() ? KDiamond::UntimedGame : KDiamond::NormalGame);}
开发者ID:jsj2008,项目名称:kdegames,代码行数:10,


示例6: main

int main(int argc, char *argv[]){    QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));    QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));    QApplication a(argc, argv);    MainWindow w;    Lobby lobby;    QObject::connect(&lobby, SIGNAL(startGame(QString,qint16)), &w, SLOT(startGame(QString,qint16)));    lobby.show();    return a.exec();}
开发者ID:NinjaTrappeur,项目名称:pong-client,代码行数:14,


示例7: startGame

	void GameManager::preOnMouse(int button, int state, int x, int y) 	{		if (!_gameMode) {			if(x >= 265 && x <= 555 && y >= 270 && y <= 330)				startGame(2);		}	}
开发者ID:shadowpt,项目名称:CastleBlast,代码行数:7,


示例8: assert

bool ClientLobbyRoomProtocol::notifyEventAsynchronous(Event* event){    assert(m_setup); // assert that the setup exists    if (event->getType() == EVENT_TYPE_MESSAGE)    {        const NetworkString &data = event->data();        assert(data.size()); // assert that data isn't empty        uint8_t message_type = data[0];        if (message_type == 0x03 ||            message_type == 0x06)            return false; // don't treat the event        event->removeFront(1);        Log::info("ClientLobbyRoomProtocol", "Asynchronous message of type %d", message_type);        if (message_type == 0x01) // new player connected            newPlayer(event);        else if (message_type == 0x02) // player disconnected            disconnectedPlayer(event);        else if (message_type == 0x04) // start race            startGame(event);        else if (message_type == 0x05) // start selection phase            startSelection(event);        else if (message_type == 0x80) // connection refused            connectionRefused(event);        else if (message_type == 0x81) // connection accepted            connectionAccepted(event);        else if (message_type == 0x82) // kart selection refused            kartSelectionRefused(event);        else if (message_type == 0xc0) // vote for major mode            playerMajorVote(event);        else if (message_type == 0xc1) // vote for race count            playerRaceCountVote(event);        else if (message_type == 0xc2) // vote for minor mode            playerMinorVote(event);        else if (message_type == 0xc3) // vote for track            playerTrackVote(event);        else if (message_type == 0xc4) // vote for reversed mode            playerReversedVote(event);        else if (message_type == 0xc5) // vote for laps            playerLapsVote(event);        return true;    } // message    else if (event->getType() == EVENT_TYPE_CONNECTED)    {        return true;    } // connection    else if (event->getType() == EVENT_TYPE_DISCONNECTED) // means we left essentially    {        NetworkManager::getInstance()->removePeer(m_server);        m_server = NULL;        NetworkManager::getInstance()->disconnected();        m_listener->requestTerminate(this);        NetworkManager::getInstance()->reset();        // probably the same as m_server        NetworkManager::getInstance()->removePeer(event->getPeer());        return true;    } // disconnection    return false;}   // notifyEventAsynchronous
开发者ID:rugk,项目名称:stk-code,代码行数:60,


示例9: updateGameIssues

static void updateGameIssues(void){    handleDPad();    if (issue == COUNT_ISSUES && padX > 0) padX = 0;    if (padX != 0 || padY != 0) {        int tmp = issue + padX + padY * 5;        if (tmp >= 0 && tmp <= COUNT_ISSUES + 4) {            issue = min(tmp, COUNT_ISSUES);            playSoundTick();            isInvalid = true;        }    }    if (arduboy.buttonDown(A_BUTTON)) {        setSound(!arduboy.isAudioEnabled());        playSoundClick();        isInvalid = true;    }    if (arduboy.buttonDown(B_BUTTON)) {        if (issue == COUNT_ISSUES) {            state = STATE_LEAVE;            playSoundClick();        } else {            startGame();        }    }}
开发者ID:obono,项目名称:ArduboyWorks,代码行数:26,


示例10: clear

void GroupGame::play(){    clear();    startGame();    QModeStart startInfo(0, tr("Grouping Game"));    QVBoxLayout *layout = startInfo.mainLayout();    QFormLayout form;    layout->addLayout(&form);    QSpinBox groupLength;    m_groupLengthSpinBox = &groupLength;    groupLength.setValue(int(m_goodGuesses - m_badGuesses / GROUPLENGTH_WEIGHT));    if (groupLength.value() < 1)        groupLength.setValue(1);    groupLength.setMaximum(m_WPM);    form.addRow(tr("Starting Group Length:"), &groupLength);    QSpinBox WPM;    WPM.setValue(m_WPM);    connect(&WPM, SIGNAL(valueChanged(int)), this, SLOT(limitLength(int)));    form.addRow(tr("Starting WPM:"), &WPM);    if (startInfo.exec() == QDialog::Accepted) {        m_goodGuesses = GROUPLENGTH_WEIGHT * (groupLength.value() - 1);        m_WPM = WPM.value();        m_morse->createTones(m_WPM);        startNextGroup();    }    m_groupLengthSpinBox = 0;}
开发者ID:corecode,项目名称:CuteCW,代码行数:32,


示例11: main

int main(int argc, char **argv) {	//Graphics Stuff	glutInit(&argc, argv);	//Framework Stuff	createHeadInst();	startGame(argc, argv);	glutKeyboardFunc(KeyDown);	glutKeyboardUpFunc(KeyUp);	glutMouseFunc(Mouse);	glutTimerFunc(GAME.STEPTIME, Step, 0);	glutDisplayFunc(Draw);	glutTimerFunc(GAME.FRAMERATE, FPS, 0);	glutPassiveMotionFunc(moveMouse);	//glutIdleFunc(Draw);	//Aaaaand... we're off!	loadShaders("gameMachine/vertShader", "gameMachine/fragShader");	glutInitDisplayMode(GLUT_DOUBLE|GLUT_RGBA|GLUT_DEPTH|GLUT_STENCIL);	glEnable(GL_TEXTURE_2D);	glEnable(GL_BLEND);	glEnable(GL_DEPTH_TEST);	glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);	glutMainLoop();	return 0;}
开发者ID:theronrabe,项目名称:gameMachine,代码行数:27,


示例12: QMenuBar

void Window::dealMenu(void){	QMenuBar * MenuBar = new QMenuBar(this);	QMenu * GameMenu = new QMenu(tr("GAME"), MenuBar);	QMenu * HelpMenu = new QMenu(tr("Help"), MenuBar);	QAction * StartGame = new QAction(tr("Start"), GameMenu);	QAction * StopGame = new QAction(tr("End"), GameMenu);	QAction * QuitGame = new QAction(tr("Quit"), GameMenu);	GameMenu->addAction(StartGame);	GameMenu->addAction(StopGame);	GameMenu->addAction(QuitGame);	MenuBar->addMenu(GameMenu);	connect(StartGame, SIGNAL(triggered()), this, SLOT(startGame()));	connect(StopGame, SIGNAL(triggered()), this, SLOT(stopGame()));	connect(QuitGame, SIGNAL(triggered()), this, SLOT(close()));	QAction * About = new QAction(tr("About"), HelpMenu);	HelpMenu->addAction(About);	MenuBar->addMenu(HelpMenu);	connect(About, SIGNAL(triggered()), this, SLOT(showAbout()));	setMenuBar(MenuBar);}
开发者ID:huy10,项目名称:GoBang,代码行数:26,


示例13: switch

void Game::keyPressEvent(QKeyEvent *event) {    switch (event->key()) {    case Qt::Key_Left:         snake->dir = Snake::LEFT;       break;    case Qt::Key_Right:          snake->dir = Snake::RIGHT;        break;    case Qt::Key_Up:          snake->dir = Snake::UP;        break;    case Qt::Key_Down:          snake->dir = Snake::DOWN;        break;    case Qt::Key_P:          pauseGame();        break;    case Qt::Key_Space:          startGame();        break;    case Qt::Key_Escape:          qApp->exit();        break;    default:        QWidget::keyPressEvent(event);    }    repaint();}
开发者ID:plusdeng,项目名称:QTSnake-Cplusplus_Version1,代码行数:28,


示例14: startGameFromFile

void startGameFromFile(const std::string &fname){	StartInfo si;	try //attempt retrieving start info from given file	{		if(!fname.size() || !boost::filesystem::exists(fname))			throw std::runtime_error("Startfile /"" + fname + "/" does not exist!");		CLoadFile out(fname);		if(!out.sfile || !*out.sfile)		{			throw std::runtime_error("Cannot read from startfile /"" + fname + "/"!");		}		out >> si;	}	catch(std::exception &e)	{		logGlobal->errorStream() << "Failed to start from the file: " + fname << ". Error: " << e.what() 			<< " Falling back to main menu.";		GH.curInt = CGPreGame::create();		return;	}	while(GH.topInt())		GH.popIntTotally(GH.topInt());	startGame(&si);}
开发者ID:yzliang,项目名称:vcmi,代码行数:27,


示例15: startGame

void GamesScence::btRestartCallback(Ref* pSender,Widget::TouchEventType type){	if(type == Widget::TouchEventType::ENDED)	{		startGame();	}}
开发者ID:bluesky466,项目名称:Tetris,代码行数:7,


示例16: mouseLock

void GameScene::mousePressEvent(QGraphicsSceneMouseEvent *event){    if(event->button()==Qt::LeftButton){        if(!backPackBar->isShow() && !inOpWidget){            if(!inSence){                inSence=true;                mouseLock();                camera->bind();                startGame();            }            else{                emit removeBlock();            }        }    }    else if(event->button()==Qt::RightButton){        if(!backPackBar->isShow() && !inOpWidget){            if(inSence){                emit addBlock();            }        }    }    else if(event->button() & Qt::MidButton){       //中间拾取        if(!backPackBar->isShow()){            if(inSence){                //...获得已选中方块的属性并传给物品栏                if(camera->getKeyPosition().y()>=0)                    itemBar->midBlock(world->getBlockIndex(world->getBlock(camera->getKeyPosition())->getId()));            }        }    }    QGraphicsScene::mousePressEvent(event);}
开发者ID:hellckt,项目名称:DivineCraft,代码行数:33,


示例17: qsrand

void KBlocksWin::startGame(){    qsrand(time(0));    mpGameLogic->setGameSeed(qrand());    if (mpGameLogic->startGame(mGameCount)) {        mpPlayManager->startGame();        mpGameScene->createGameItemGroups(mGameCount, false);        mpGameScene->startGame();        int levelUpTime = 0;        switch ((int) Kg::difficultyLevel()) {        case KgDifficultyLevel::Medium:            levelUpTime = 5;            break;        case KgDifficultyLevel::Hard:            levelUpTime = 10;            break;        }        mpGameLogic->levelUpGame(levelUpTime);        Kg::difficulty()->setGameRunning(true);    } else {        stopGame();        startGame();    }    mScore->setText(i18n("Points: %1 - Lines: %2 - Level: %3", 0, 0, 0));    m_pauseAction->setEnabled(true);    m_pauseAction->setChecked(false);}
开发者ID:KDE,项目名称:kblocks,代码行数:32,


示例18: ofGetElapsedTimeMillis

//--------------------------------------------------------------void testApp::keyPressed(int key){	if(gameOver){		gameOver = 0;		gameEndsAt = ofGetElapsedTimeMillis() + gameDuration;		circles.clear();		lastTimeUsed = ofGetElapsedTimeMillis();		startGame();		return;	}	if(ofGetElapsedTimeMillis() - cooldown > lastTimeUsed){		real str = 500.0f;		Vector2 vec;		if(key == 'a'){			vec.x = -1;		}		if(key == 'w'){			vec.y = -1;		}		if(key == 'd'){			vec.x = 1;		}		if(key == 's'){			vec.y = 1;		}		pball->setVelocity(pball->getVelocity() + vec * str);		lastTimeUsed = ofGetElapsedTimeMillis();	}}
开发者ID:adamschoenemann,项目名称:Pinball,代码行数:30,


示例19: drawPanel

void Game::showGameOverMenu(int player_id) {    int n = scene->items().size();    for(int i = 0; i < n; i++) {        scene->items()[i]->setEnabled(false);    }    drawPanel(0, 0, 1024, 768, QColor(Qt::lightGray), 0.65);    drawPanel(1024/2 - 200,200,400,400,QColor(Qt::darkGray), 0.85);    QGraphicsTextItem *lbl_go_text = new LabelItem("Konec hry", 0, 0);    lbl_go_text->setPos(scene->width()/2 - lbl_go_text->boundingRect().width()/2, 250);    scene->addItem(lbl_go_text);    QGraphicsTextItem *lbl_player_won = new LabelItem(QString("Vyhral hrac c. %1").arg(player_id), 0, 0);    lbl_player_won->setPos(scene->width()/2 - lbl_player_won->boundingRect().width()/2, 275);    scene->addItem(lbl_player_won);    Button *restart_btn = new Button(QString("Hrat znovu"));    int x = scene->width()/2 - restart_btn->boundingRect().width()/2;    int y = 325;    restart_btn->setPos(x, y);    connect(restart_btn, SIGNAL(clicked()), this, SLOT(startGame()));    scene->addItem(restart_btn);    Button *back_to_menu_btn = new Button(QString("Vratit do menu"));    x = scene->width()/2 - back_to_menu_btn->boundingRect().width()/2;    y += 75;    back_to_menu_btn->setPos(x, y);    connect(back_to_menu_btn, SIGNAL(clicked()), this, SLOT(showMainMenu()));    scene->addItem(back_to_menu_btn);    Button *exit_btn = new Button(QString("Konec"));    x = scene->width()/2 - exit_btn->boundingRect().width()/2;    y += 75;    exit_btn->setPos(x, y);    connect(exit_btn, SIGNAL(clicked()), this, SLOT(close()));    scene->addItem(exit_btn);}
开发者ID:Selfer,项目名称:ICP-2015,代码行数:34,


示例20: startGame

void PlayField::restart(bool ask){    Animator::instance()->restart();    m_seaView->clear();    startGame();    m_controller->restart(ask);}
开发者ID:alasin,项目名称:knavalbattle,代码行数:7,


示例21: doStartButton

void doStartButton() {	if (g_state == STATE_PLAYING) {		paused = !paused;	} else if (g_state == STATE_GAMEOVER) {		backToTitleScreen();	} else if (g_state == STATE_TITLE) {		if (g_menuState == MENU_DESCRIBE_LEVEL) {			startGame();								} else if (g_menuState == MENU_PICK_LEVEL) {			g_menuState = MENU_DESCRIBE_LEVEL;		} else if (g_menuState == MENU_MAINMENU) {			if (g_menuItem==0) {								// Play				g_menuState = MENU_PICK_LEVEL;			} else if (g_menuItem==1) {				// Hi Scores				g_state = STATE_GAMEOVER;			} else if (g_menuItem==2) {							// Help				g_menuState = MENU_HELP;			} else if (g_menuItem==3) {				do_quit();			}		} else if (g_menuState == MENU_HELP ) {			g_menuState = MENU_MAINMENU;		}	}	}
开发者ID:bradparks,项目名称:ld48jovoc_food_fight_3d_luxe,代码行数:31,


示例22: request

        void        Ready::execute()        {            Component::Player*      player =                _entity->getComponent<Component::Player>();            Component::NetworkTCP*  network =                _entity->getComponent<Component::NetworkTCP>();            Component::Room*        room;            if (player == nullptr || network == nullptr)                throw std::runtime_error("Entity does not have a "                                         "player/network component");            if ((room = player->getRoom()) == nullptr                || !room->setPlayerReadiness(*_entity, true))                network->send(Server::responseKO);            else            {                RType::Request         request(RType::Request::SE_CLIENTRDY);                request.push<uint8_t>("player_id", room->getPlayerId(*_entity));                network->send(Server::responseOK);                room->broadcastTCP(request.toBuffer(), _entity);                if (room->allReady())                    startGame(room);            }        }
开发者ID:ishigo974,项目名称:rtype,代码行数:25,


示例23: keyReleased

//--------------------------------------------------------------void Game::keyReleased(int key) {        if (key == 'p') startGame();    if (key == 'r') toggleState();        if (!locked)    {        //players keyboards extra controls        switch(key)        {             case OF_KEY_UP: playerList[0].applyImpulse(); break;			case OF_KEY_DOWN: playerList[0].setDirection(0); break;            case OF_KEY_LEFT: playerList[0].setDirectionIncrement(-1); break;			case OF_KEY_RIGHT: playerList[0].setDirectionIncrement(1); break;                        case 'w': playerList[1].applyImpulse(); break;            case 's': playerList[1].setDirection(0); break;            case 'a': playerList[1].setDirectionIncrement(-1); break;            case 'd': playerList[1].setDirectionIncrement(1); break;                        case 'y': playerList[2].applyImpulse(); break;            case 'h': playerList[2].setDirection(0); break;            case 'g': playerList[2].setDirectionIncrement(-1); break;            case 'j': playerList[2].setDirectionIncrement(1); break;                        case 'Y': playerList[3].applyImpulse(); break;            case 'H': playerList[3].setDirection(0); break;            case 'G': playerList[3].setDirectionIncrement(-1); break;            case 'J': playerList[3].setDirectionIncrement(1); break;        }    }}
开发者ID:amarocolas,项目名称:Game,代码行数:33,


示例24: onKeyPress

void onKeyPress(int keyCode) {	if(titleScreen->visible == 1) {		titleScreenKeyPress(keyCode);		return;	}	if(helpScreen->visible == 1) {		helpScreen->visible = 0;		startGame();		return;	}		if(gameoverScreen->visible == 1) {		if(gameoverkeylock == 0) {			gameoverScreen->visible = 0;			titleScreen->visible = 1;		}		return;	}	if(aboutScreen->visible == 1) {		hideIntro();		return;	}	if(	hiscoreScreen->visible == 1) {			hiscoreScreen->visible = 0;			titleScreen->visible = 1;			return;	}			gameScreenKeyPress(keyCode);}
开发者ID:cnsoft,项目名称:librgs,代码行数:35,


示例25: startGame

void guessGame::play(){    startGame();    showGuess();    while(playMore())        showGuess();}
开发者ID:alannet,项目名称:example,代码行数:7,


示例26: showMenu

void showMenu(){	int selectMenu = 0;	while (1)	{		printf("** Bulls And Cows **/n");		printf("  [1] Start Game/n");		printf("  [2] Exit Game/n");		printf(" [] select Number : ");		scanf("%d", &selectMenu);		clearEnter();		switch (selectMenu)		{			case 1:				startGame();				break;			case 2:				exitGame();				exit(0);				break;			default:				printf("[Error] Invalid value selected!/n");				showMenu();				break;		}	}}
开发者ID:daniel-kisoon-kwon,项目名称:bulls-and-cows,代码行数:30,


示例27: QMainWindow

MainWindow::MainWindow(QWidget *parent) :    QMainWindow(parent),    ui(new Ui::MainWindow),    currentColor(QColor("#000")),    game(new GameWidget(this)){    ui->setupUi(this);    QPixmap icon(16, 16);    icon.fill(currentColor);    ui->colorButton->setIcon( QIcon(icon) );    connect(ui->startButton, SIGNAL(clicked()), game,SLOT(startGame()));    connect(ui->stopButton, SIGNAL(clicked()), game,SLOT(stopGame()));    connect(ui->clearButton, SIGNAL(clicked()), game,SLOT(clear()));    connect(ui->iterInterval, SIGNAL(valueChanged(int)), game, SLOT(setInterval(int)));    connect(ui->cellsControl, SIGNAL(valueChanged(int)), game, SLOT(setCellNumber(int)));    connect(ui->colorButton, SIGNAL(clicked()), this, SLOT(selectMasterColor()));    connect(ui->saveButton, SIGNAL(clicked()), this, SLOT(saveGame()));    connect(ui->loadButton, SIGNAL(clicked()), this, SLOT(loadGame()));    ui->mainLayout->setStretchFactor(ui->gameLayout, 8);    ui->mainLayout->setStretchFactor(ui->setLayout, 2);    ui->gameLayout->addWidget(game);}
开发者ID:ArtChecnokov,项目名称:conway,代码行数:26,


示例28: startGame

void BaseGame::toggleState() {		if(state==STATE_PLAYING) changeState(STATE_GAMEOVER);	else startGame(); }
开发者ID:sebleedelisle,项目名称:lazerarcade,代码行数:7,


示例29: startMenu

// main menuvoid startMenu(){	int menuNum=0;	char key;	system("cls");	setWindowSize();	startImage();	while(1)	{		Sleep(200);		if(kbhit())		{			key=getch();			if(key=='1'||key=='2'||key=='3')				break;		}	}	if(key=='1')	{		startGame();		return;	}	else if (key=='2')	{		showRank();		Sleep(2000);		startMenu();		return;	}else if(key=='3')		exit;		return;}
开发者ID:dacapolife87,项目名称:CoinStackProject,代码行数:35,



注:本文中的startGame函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ startLink函数代码示例
C++ startExecutor函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。