int main() { int input; printf("Welcome!\n"); printf("1. Single Player\n"); printf("2. Multiplayer\n"); printf("3. Load Game\n"); printf("4. Exit\n"); printf("Selection:"); scanf("%d", &input); switch (input) { case 1: singleplayer(); break; case 2: multiplayer(); break; case 3: loadgame(); break; case 4: printf("Thanks for playing!\n"); break; default: printf("Bad input, quitting!\n"); break; } return 0; }
void GameMenu::setConnections() { connect(this->buttons[0], SIGNAL(clicked()), this, SLOT(singleplayer())); connect(this->buttons[1], SIGNAL(clicked()), this, SLOT(multiplayer())); connect(this->buttons[2], SIGNAL(clicked()), glView, SLOT(quit())); connect(this->buttons[3], SIGNAL(clicked()), this, SLOT(getPaddle())); connect(this->buttons[4], SIGNAL(clicked()), this, SLOT(unpause())); connect(this->buttons[5], SIGNAL(clicked()), this, SLOT(reset())); connect(this->buttons[6], SIGNAL(clicked()), this, SLOT(reset())); }