-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtdefense.h
93 lines (75 loc) · 2.26 KB
/
tdefense.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
#ifndef TDEFENSE_H
#define TDEFENSE_H
#pragma once
#include "student.h"
#include "problem.h"
#include "assignment.h"
#include "paper.h"
#include "midterm.h"
#include "tower.h"
#include "bullet.h"
#include <QVector>
#include <QWidget>
#include <QImage>
#include <QRect>
#include <QKeyEvent>
#include <QMouseEvent>
class TDefense : public QWidget
{
Q_OBJECT
private:
int timerID;
Student *myStudent;
int IQ, funds, extensions;
//Enemy Lists
QVector<Problem*> myProblems;
QVector<Assignment*> myAssignments;
QVector<Paper*> myPapers;
QVector<Midterm*> myMidterms;
//Tower Lists
QVector<Tower*> myTowers;
//Bullet Lists
QVector<Bullet*> myStudentBullets;
QVector<Bullet*> myTowerBullets;
int gpWidth, gpHeight;
int week, semester, year;
int timerInterval, launchModerator,
numEnemiesLaunched, numEnemiesDropped, numEnemiesShot;
QRect *windowRect; //This is used to "clear" the window
bool isStarted, isPaused, isLaunched, isOver, isWon,
studentShotFired, studentBulletAdded, towerBulletAdded;
QImage *problem, *assignment1, *assignment2, *paper1, *paper2, *paper3, *paper4, *paper5,
*midterm1, *midterm2, *midterm3, *midterm4, *midterm5, *midtermA, *midtermB, *midtermC,
*pencil, *student, *pi, *stapler, *staple;
public:
TDefense(QWidget *parent = 0);
~TDefense();
void start();
void pause();
void launch();
void gameOver();
void gameWon();
void enemyAction();
void problemAction();
void assignmentAction();
void paperAction();
void midtermAction();
void clearEnemies();
void clearProblems();
void clearAssignments();
void clearPapers();
void clearMidterms();
void studentAction();
void towerAction();
void dragTower();
void towerShoot();
void studentShoot(QPoint *target);
protected:
void paintEvent(QPaintEvent *event);
void timerEvent(QTimerEvent *event);
void keyPressEvent(QKeyEvent *event);
void mousePressEvent(QMouseEvent *event);
private:
void InitializeInstanceFields();
}; // end class definition
#endif // TDEFENSE_H