Example #1
0
void InputDialog::on_btnOk_clicked()
{
    QString name = inputui->lineEditName->text();
    int difficulty = inputui->cmbBoxDifficulty->currentIndex();

    if (name == "" || name == NULL){
        QMessageBox::warning(this, "Error", "Please provide a name.");
        return;
    }

    this->close();

    GameWorld::accessWorld().setPlayerName(name);
    GameWorld::accessWorld().setDifficulty(difficulty);

    //create the bricks for a level
    GameWorld::accessWorld().makeLevel();

    //make gamewindow and show it
    GameWindow* gamewindow = new GameWindow(music);

    //create the GUIBricks for a level
    gamewindow->renderLevel();

    //set the position of the gamewindow
    gamewindow->setGeometry(373, 0, 642, 608);

    music->stop(); //stop the music

    //show the game window
    gamewindow->show();
}
Example #2
0
/*
*
*Program written by Johna Rutz
*Game of concentration using pictures from John Campbell's webcomic PicturesForSadChildren.com
*(And pictures of coffee in the harder levels)
*
*
*/
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    GameWindow w;
    w.show();
    
    return a.exec();
}
Example #3
0
void CraftuxHome::soloGameLaunch()
{
	// Création et génération du monde
	ServerConnector* connector = new LocalServerConnector();
	GameWindow* gameWindow = new GameWindow(connector);
	this->close();
	gameWindow->show();
}
int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    GameWindow gameWindow;
    gameWindow.show();

    return app.exec();
}
Example #5
0
void
GameSession::start_game(QGraphicsScene *scn)
{
	userwindow->hide();

	GameWindow *gamewindow = new GameWindow(scn);

	gamewindow->show();
	/* constructor ? */
}
Example #6
0
/**
 * @brief Entrée du programme.
 * @param argc Correspond au nombre d'arguments.
 * @param argv Correspond aux arguments donnés.
 * @return Une boucle infini sur a.exec().
 *  \n a.exec() correspond est l'application graphique qui
 *  s'occupera de lancer notre programme.
 */
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    qRegisterMetaTypeStreamOperators<PlayerLight>("PlayerLight");

    Q_INIT_RESOURCE(res);
    GameWindow game;
    game.show();

    return a.exec();
}
Example #7
0
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    int fontId = QFontDatabase::addApplicationFont(":recources/fonts/UpheavalPro.ttf");
    QString family = QFontDatabase::applicationFontFamilies(fontId).at(0);
    QFont font(family);
    a.setFont(font);

    GameWindow w;
    w.show();

    return a.exec();
}
Example #8
0
// Start method main
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    // Create splashscreen object
    QSplashScreen *splash = new QSplashScreen;
    splash->setPixmap(QPixmap(":/img/images/splash.png"));
    splash->show();

    // Create database object
    Database *db = new Database();

    Qt::Alignment topRight = Qt::AlignRight | Qt::AlignTop;

    splash->showMessage(QObject::tr("Establishing connections..."),
                        topRight, Qt::white);
    // Database connection
    if(!db->createConnection())
        return 1;
    // Client connection
    Clock clock;
    clock.show();


    splash->showMessage(QObject::tr("Setting up main window..."),
                        topRight, Qt::white);
    // Create game window
    GameWindow gameWindow;

    splash->showMessage(QObject::tr("Setting up game..."),
                            topRight, Qt::white);
    // create game
    Game *game = new Game();

    gameWindow.setCentralWidget(game);
    gameWindow.show();
    splash->finish(&gameWindow);

    delete splash;

    return a.exec();
}// End method main
Example #9
0
int main() 
{ 
    GameWindow window; 
    window.show(); 
} 
Example #10
0
//测试兼主函数
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    SetCodec();
    qDebug()<<QCoreApplication::applicationDirPath();
    //单元测试方框父类

//    FatherBlock testFatherBlock;
//    testFatherBlock.InitBlocksList();
//    testFatherBlock.show();
//       QBitArray newstatus(16);
//       newstatus.setBit(0,true);
//       newstatus.setBit(1,true);
//       newstatus.setBit(5,true);
//       newstatus.setBit(6,true);
//       qDebug()<<testFatherBlock.addStatus(newstatus);

//       QBitArray newstatus1(16);
//       newstatus1.setBit(1,true);
//       newstatus1.setBit(4,true);
//       newstatus1.setBit(5,true);
//       newstatus1.setBit(8,true);
//       qDebug()<<testFatherBlock.addStatus(newstatus1);


    //单元测试游戏窗体
    GameWindow w;
    w.show();

 // TestUnit for Ranking
//    GameRankingList TestGame;
    //TestItem
//    GameRankingItem newItem("testgame","testUser",100);
//    GameRankingItem newItem2(newItem);
//    qDebug()<<newItem.GetItemstr()<<"Item1";
//    qDebug()<<newItem2.GetItemstr()<<"Item2";
//    TestList
//    for(int i = 0;i<10;i++)
//    {
//        TestGame.AddGameRecord("TestUser",qrand() % 12);
//    }
//    qDebug()<<TestGame.SaveAsFile("TestRecord.txt");
    //TestGame.InitWithFile("TestRecord.txt");
//    QList<GameRankingItem> theList = TestGame.GetItemsList();
//    for(int i = 0;i<theList.count();i++)
//    {
//        qDebug()<<theList[i].GetMark();
//    }


//    GameRankingList::SortListbyMark(theList);
//     qDebug()<<"----------------------------";
//    for(int i = 0;i<theList.count();i++)
//    {
//        qDebug()<<theList[i].GetMark();
//    }



  //TestForRankingForm
//    GameRankForm theTestForm;
//    for(int i = 0;i<10;i++)
//    {
//        theTestForm.AddNewGameRecord("TestUser"+QString::number(i),qrand() % 12);
//    }
//    theTestForm.RefreshRankList();
//    theTestForm.show();



    return a.exec();
}
Example #11
0
int main() {
	//cout << "x=" << player::pos.x <<  " y=" << player::pos.y << "  health=" << player::health << " visible=" << player::visible << endl;
    GameWindow window;
    window.show();
}
Example #12
0
void GameWindow::refreshGame()
{
    GameWindow *newWindow = new GameWindow(sizeOfFieldX, sizeOfFieldY, minesInTheField);
    newWindow->show();
    this->close();
}
Example #13
0
int main (int argc, char* argv[]) {
	GameWindow win;
	win.show();
	return 0;
}