-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStudentWorld.h
77 lines (70 loc) · 2.07 KB
/
StudentWorld.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
#ifndef STUDENTWORLD_H_
#define STUDENTWORLD_H_
#include "GameWorld.h"
#include "Level.h"
#include <string>
#include <sstream>
#include <iomanip>
#include <list>
#include "Actor.h"
class GraphObject;
class Avatar;
class Actor;
// Students: Add code to this file, StudentWorld.cpp, Actor.h, and Actor.cpp
class StudentWorld : public GameWorld
{
public:
StudentWorld(std::string assetPath);
virtual int init();
virtual int move();
virtual void cleanUp();
bool damageWProjectile(int X, int Y, Actor* ptr);
bool overlapActor(int X, int Y, Actor* ptr);
bool overlapActorNoPeaNoPitNoExitNoGoodies(int X, int Y, Actor* ptr);
Actor* overlapActorMarble(int X, int Y, Actor* ptr);
Actor* overlapActorPit(int X, int Y, Actor* ptr);
Actor* overlapActorPea(int X, int Y, Actor* ptr);
ThiefBot* overlapActorThiefBot(int X, int Y, Actor* ptr);
bool overlapAvatar(int X, int Y);
void displayGameText();
Avatar* getAvatar() {
return m_player;
}
bool getCompleteLevel() const {
return m_completeLevel;
}
void setCompleteLevel(bool status) {
m_completeLevel = status;
}
void setLevelBonus(int new_levelBonus) {
levelBonus = new_levelBonus;
}
bool finishGame() const {
return m_finishGame;
}
void setFinishGame(bool status) {
m_finishGame = status;
}
bool playerDiedDuringThisTick();
bool playerCompletedTheCurrentLevel();
void reduceLevelBonusByOne();
int getCurrentLevelBonus() const;
bool checkActorsOverlap(int X1, int Y1, int X2, int Y2);
void createProjectile(int X, int Y, int direction);
void createThiefBot(int X, int Y, int direction, bool isMean);
int getNumCrystals() const {
return numCrystals;
}
void setNumCrystals(int value) {
numCrystals = value;
}
void spawnThiefBot(ThiefBot* thiefbot);
private:
Avatar* m_player;
std::list<Actor*> actors;
int numCrystals = 0;
bool m_completeLevel = false;
bool m_finishGame = false;
int levelBonus = 1000;
};
#endif // STUDENTWORLD_H_