-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdoodlejump.h
73 lines (62 loc) · 1.73 KB
/
doodlejump.h
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#ifndef DOODLEJUMP_H
#define DOODLEJUMP_H
#include "mainwindow.h"
#include "player.h"
#include "platform.h"
#include "button.h"
#include "hazard.h"
#include "score.h"
#include <QObject>
#include <QTimer>
#include <QGraphicsView>
#include <QGraphicsScene>
#include <QGraphicsPixmapItem>
#include <QGraphicsTextItem>
#include <QVector>
#include <QString>
class Player;
class Platform;
class Hazard;
class Score;
class DoodleJump:public QObject
{
Q_OBJECT;
friend class MainWindow; // not sure it is necessary
public:
DoodleJump(QGraphicsView * = NULL);
void spawnPlaform(int);
void cleanPlatform();
void end();
void cleanScene();
bool getTurnOnSound();
bool isEnd;
QTimer * timer;
public slots:
void play();
void pause();
void resume();
void menu();
void option();
void scores();
void switchSound();
void setBackGround();
private:
bool isOverlapping(QGraphicsPixmapItem *);
bool possiability(float);
int score, highestScore, last;
bool turnOnSound;
QString name;
Player * player;
Score * scoreData;
QGraphicsScene * scene;
QGraphicsView * view;
QGraphicsPixmapItem background[2];
QVector<Platform *> platforms;
QVector<Hazard *> hazards;
QMediaPlayer * endSound;
QGraphicsPixmapItem * welcomeBackground, * pauseBackground, * scoreBackground, * optionBar, * toolBar, * endBar, * gameOver, * tapToChange, * soundText;
QGraphicsTextItem * scoreText, * endText, * nameText;
Button * playButton, * pauseButton, * resumeButton, * playAgainButton, * menuButton, *optionButton, *scoreButton;
Option * OnOffButton, * localButton;
};
#endif // DOODLEJUMP_H