Educational Game Platform
gamescene_1.h
Go to the documentation of this file.
1 #ifndef GAMESCENE_1_H
2 #define GAMESCENE_1_H
3 
4 #include "gamescene_1_player.h"
5 #include "gamescene_1_dice.h"
6 #include "gamescene_1_ladderSnake.h"
7 #include <QGraphicsScene>
8 #include <QWidget>
9 #include <QtWidgets>
10 #include <QSound>
11 #include <QFuture>
12 #include <QThread>
13 #include <QtConcurrent/QtConcurrent>
14 #include <stdlib.h>
15 #include <time.h>
16 
23 class gameScene_1 : public QGraphicsScene
24 {
25  Q_OBJECT
26 public:
27  explicit gameScene_1(QObject *parent = 0);
28 
29  //Sidebar
30  QGraphicsTextItem *text;
31  QGraphicsTextItem *text2;
32  QGraphicsTextItem *text3;
33  QPushButton *rolldice;
34  QPushButton *pickdice1;
35  QPushButton *pickdice2;
36  QPushButton *backtomenu;
37 
38 
39  //Players item
42 
43  //Dice item
46 
47  //LadderSnake Gen + Brush
49  QGraphicsRectItem* square;
50 
51  //LadderSnake positions
52  int *ladderPos;
53  int *snakePos;
54 
55  //Logic items
56  bool *firstRoll;
57  bool *playerTurn;
58  bool *sidePick;
59  bool *winState;
60  bool *winner;
61 
62  //CPU or Human Player
63  bool *CPU;
64 
65 
66 
67 
68 
69 
70 
71 signals:
72 
73 public slots:
74 void generateBoard();
75 void selectLeft();
76 void selectRight();
77 void diceRoll();
78 void checkSnakeLadder();
79 void winCondition();
80 void movePlayer();
81 void movePlayerOpp();
82 void backToMenu();
83 void loadGame(int posp1,int posp2, bool turn);
84 };
85 
86 #endif // GAMESCENE_1_H
gameScene_1::sidePick
bool * sidePick
Bool denoting left/right dice pick.
Definition: gamescene_1.h:58
gameScene_1::selectLeft
void selectLeft()
gameScene_1::selectLeft
Definition: gamescene_1.cpp:498
gameScene_1::snakePos
int * snakePos
Array used to store Snake start/end positions.
Definition: gamescene_1.h:53
gameScene_1_dice
Definition: gamescene_1_dice.h:18
gameScene_1::firstRoll
bool * firstRoll
Bool denoting first roll status.
Definition: gamescene_1.h:56
gameScene_1::selectRight
void selectRight()
gameScene_1::selectRight
Definition: gamescene_1.cpp:545
gameScene_1::movePlayerOpp
void movePlayerOpp()
gameScene_1::movePlayerOpp
Definition: gamescene_1.cpp:314
gameScene_1::playerTurn
bool * playerTurn
Bool denoting player turn.
Definition: gamescene_1.h:57
gameScene_1::ladderSnake
gamescene_1_ladderSnake * ladderSnake
Ladder&Snake entity.
Definition: gamescene_1.h:48
gameScene_1::movePlayer
void movePlayer()
gameScene_1::movePlayer
Definition: gamescene_1.cpp:269
gameScene_1::pickdice2
QPushButton * pickdice2
Button associated to pick a dice.
Definition: gamescene_1.h:35
gameScene_1::winState
bool * winState
Bool denoting win state.
Definition: gamescene_1.h:59
gamescene_1_dice.h
The gameScene_1_dice class.
gameScene_1_player
Definition: gamescene_1_player.h:19
gameScene_1::player2
gameScene_1_player * player2
Player 2 entity.
Definition: gamescene_1.h:41
gameScene_1::text
QGraphicsTextItem * text
Text element in GUI.
Definition: gamescene_1.h:30
gameScene_1::CPU
bool * CPU
Bool denoting CPU adversary / human adversary.
Definition: gamescene_1.h:63
gameScene_1::text2
QGraphicsTextItem * text2
Text element in GUI.
Definition: gamescene_1.h:31
gameScene_1::player1
gameScene_1_player * player1
Player 1 entity.
Definition: gamescene_1.h:40
gameScene_1::diceRoll
void diceRoll()
gameScene_1::diceRoll
Definition: gamescene_1.cpp:359
gameScene_1::dice1
gameScene_1_dice * dice1
Dice 1 entity.
Definition: gamescene_1.h:44
gameScene_1::backToMenu
void backToMenu()
gameScene_1::backToMenu
Definition: gamescene_1.cpp:152
gameScene_1
Definition: gamescene_1.h:24
gameScene_1::square
QGraphicsRectItem * square
Boxes used to denote ladder/snakes.
Definition: gamescene_1.h:49
gameScene_1::generateBoard
void generateBoard()
gameScene_1::generateBoard
Definition: gamescene_1.cpp:591
gameScene_1::loadGame
void loadGame(int posp1, int posp2, bool turn)
gameScene_1::loadGame
Definition: gamescene_1.cpp:118
gameScene_1::backtomenu
QPushButton * backtomenu
Button associated to going back to menu.
Definition: gamescene_1.h:36
gameScene_1::ladderPos
int * ladderPos
Array used to store Ladder start/end positions.
Definition: gamescene_1.h:52
gameScene_1::pickdice1
QPushButton * pickdice1
Button associated to pick a dice.
Definition: gamescene_1.h:34
gameScene_1::dice2
gameScene_1_dice * dice2
Dice 2 entity.
Definition: gamescene_1.h:45
gameScene_1::text3
QGraphicsTextItem * text3
Text element in GUI.
Definition: gamescene_1.h:32
gameScene_1::rolldice
QPushButton * rolldice
Button associated to rolling the dices.
Definition: gamescene_1.h:33
gameScene_1::winCondition
void winCondition()
gameScene_1::winCondition
Definition: gamescene_1.cpp:466
gamescene_1_ladderSnake
Definition: gamescene_1_ladderSnake.h:16