-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjeu.h
97 lines (81 loc) · 2.02 KB
/
jeu.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#ifndef JEU_H
#define JEU_H
#define J1 0
#define J2 1
#define T_OBUS 0
#define T_MISSILE 1
#define T_NUKE 2
#include <QApplication>
#include <QWidget>
#include <QGraphicsView>
#include <QGraphicsScene>
#include <QBrush>
#include <QColor>
#include <QLine>
#include <QPushButton>
#include <QGraphicsRectItem>
#include <QGraphicsProxyWidget>
#include <QGraphicsPixmapItem>
#include <QPoint>
#include <QLabel>
#include <QPalette>
#include <QLCDNumber>
#include <QSlider>
#include <QRadioButton>
#include <QKeyEvent>
#include <time.h>
#include "terrain.h"
#include "obstacle.h"
#include "arbre.h"
#include "crevasse.h"
#include "eau.h"
#include "roche.h"
#include "tank.h"
#include "terrainnormal.h"
#include "joueur.h"
#include "victoire.h"
#include <QDebug>
class Jeu : public QGraphicsView
{
Q_OBJECT
private:
int tour;
QGraphicsScene * scene;
int LMaxTerrain, CMaxTerrain;
Terrain ter;
QGraphicsPixmapItem *tank1;
QGraphicsPixmapItem *tank2;
Tank *tankActuel;
QGraphicsPixmapItem *imgTankActuel;
void keyPressEvent(QKeyEvent *event);
int typeProjectileSelected;//0 obus, 1 missile, 2 nuke
QGraphicsRectItem * affTourCoul;
public:
Jeu(int L, int C);
void chargerTerrain();
void mettreAJourTerrain();
void afficherTankInit(Joueur *j1, Joueur *j2);
void mettreAJourTank();
int getTour();
void setTour(int newTour);
void destructionTerrain(Projectile* tir);
int getTypeProjectileSelected() const;
void setTypeProjectileSelected(int value);
QPoint identifierCase(QPoint p);
void verifierImpact(QPoint p, int valeurAEnlever);
void victoire(int joueurGagnant);
signals:
void changementTour(int tour);
void fermeture();
void changementNbMissile(int newNbMissile);
void changementNbNuke(int newNbNuke);
public slots:
void changerTour();
void changerHorizonTankActuel(int newH);
void tirer();
void changerAngleTirActuel(int newA);
void selectObusType();
void selectMissileType();
void selectNukeType();
};
#endif // JEU_H