-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgame.cpp
53 lines (41 loc) · 1.27 KB
/
game.cpp
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
#include "game.h"
#include "ui_game.h"
#include "block.h"
#include "border.h"
#include "playerline.h"
Game::Game(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::Game)
{
ui->setupUi(this);
// create block:
//Create GraphicsScene and item to scene:
QGraphicsScene *Scene = new QGraphicsScene;
Scene->setSceneRect(0,50,850,850);// set size and coordinate of scene
//Create Collect Block from :
BLOCK *block = new BLOCK;
block->Create_Board(Scene);
// create GraphicsView:
ui->view->setScene(Scene);
ui->view->setFixedSize(850,850);
// remove scrollbars:
ui->view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
ui->view->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
// Create Border area:
BORDER *border = new BORDER;
border->Create_Border(Scene);
}
Game::~Game()
{
delete ui;
}
void Game::on_PLAY_BUTTON_3_clicked()
{
ui->stackedWidget->setCurrentIndex(1);
ui->Background->setStyleSheet("background-color: yellow");
}
void Game::on_Solo_Button_clicked()
{
ui->stackedWidget->setCurrentIndex(2);
ui->Background->setStyleSheet("background-color: White");
}