-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathunderworld.h
More file actions
57 lines (50 loc) · 1.23 KB
/
underworld.h
File metadata and controls
57 lines (50 loc) · 1.23 KB
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
#ifndef UNDERWORLD_H
#define UNDERWORLD_H
#include <QGraphicsScene>
#include <QGraphicsView>
#include "bullet.h"
#include "enemy.h"
#include "containingbox.h"
#include <QMediaPlayer>
/*
Class: Underworld
Description: The main controller for combat in the game. Contains all necessary combat logic.
*/
class Underworld: public QObject
{
Q_OBJECT
public:
Underworld(QGraphicsScene * scene);
void DrawUnderworld(Enemy * e, Player *p);
void ProcessAttackPattern(std::vector<AttackPattern> a);
void EndBattle(QString s);
void Bribe();
void EnemyDeath();
void InitiateFightSequence();
void OnItemUsed();
// void DrawInventory();
public slots:
void FireBullet(int x, int y, Direction d);
void OnFightClicked();
void SwitchToOverWorld();
void OnKeyPress(QKeyEvent *event);
void OnPlayerDeath();
public:
signals:
void OnBulletFired(int x, int y, Direction d);
void OnEnemyHit(int amount);
private:
QMediaPlayer * music;
ContainingBox * fight_box_;
ContainingBox * bribe_box_;
QGraphicsScene * scene_;
Enemy * enemy_;
Player * player_;
bool fighting_ = false;
bool fight_over_ = false;
int cx1_;
int cy1_;
int cx2_;
int cy2_;
};
#endif // UNDERWORLD_H