-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGhost.h
43 lines (29 loc) · 967 Bytes
/
Ghost.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
#pragma once
#include "Entity.h"
class Ghost : public Entity {
private:
int targetX;
int targetY;
Direction moving;
bool scattering;
int frightened;
bool outHome;
bool decision;
int number;
protected:
float calculateDistance(Labyrinth &labyrinth, int addX, int addY) const;
void movement() override;
void teleport(int x, int y) override;
bool canMove(Labyrinth &labyrinth) override;
void getSprite(int i) override;
public:
Ghost(int tilePosX, int tilePosY, int destinationX, int destinationY, float speed, int number);
bool render(int &delay, const std::vector<std::unique_ptr<Entity>> &entities, sf::RenderWindow *window,
Labyrinth &labyrinth) override;
bool isOutHome() override;
bool isScattering() override;
void setFrightened(bool f) override;
bool isFrightened() override;
void set_target(int x, int y) override;
void key(int code) override {};
};