-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmainwindow.cpp
More file actions
59 lines (51 loc) · 2 KB
/
mainwindow.cpp
File metadata and controls
59 lines (51 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDebug>
#include <QMessageBox>
#include <QFile>
#include <QErrorMessage>
#include <QString>
#include "Tetris/tetrixwindow.h"
#include "Snake/widget.h"
#include "PingPong/PingPongwindow.h"
MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent), ui(new Ui::MainWindow) {
ui->setupUi(this);
}
MainWindow::~MainWindow() {
delete ui;
}
void MainWindow::on_action_4_triggered() {
QMessageBox msgBox;
msgBox.setWindowTitle("Справка");
msgBox.setText("Приветствуем Вас в игре \"ТехноТет\"и желаем приятных впечатлений\n\n"\
"3 игры:\n\n\n"\
"Тетрис: Необходимо удалить как можно больше линий\n"\
"Управление: поворот фигуры стрелками клавиатуры, опустить - Space\n\n"\
"Змейка: \"Съесть\" как можно больше еды\n"\
"Управление: повороты змейки - клавиши W|A|S|D\n\n"
"Пинг-Понг: Необходимо набрать 10 очков\nОчки убавляются на одно, если вам забили\n"\
"Управление: стрелки клавиатуры\n\n"\
);
msgBox.exec();
}
void MainWindow::on_Exit_clicked() {
this->close();
}
void MainWindow::on_action_3_triggered() {
QMessageBox* msgBox = new QMessageBox();
msgBox->setWindowTitle("О программе");
msgBox->setText("ТехноТет\nVersion 1.1, 26 июня\n2017\n");
msgBox->exec();
}
void MainWindow::on_Game1_clicked() {
TetrixWindow* tetr = new TetrixWindow();
tetr->show();
}
void MainWindow::on_Game3_clicked() {
Widget* sn = new Widget();
sn->show();
}
void MainWindow::on_Game4_clicked() {
PingWindow* pp = new PingWindow();
pp->show();
}