-
Notifications
You must be signed in to change notification settings - Fork 0
/
Enemy.hpp
41 lines (31 loc) · 979 Bytes
/
Enemy.hpp
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
#ifndef ENEMY_H
#define ENEMY_H
#include <SFML/Graphics.hpp>
#include "Vec.hpp"
class Enemy{
int _nextPositionIndex;
protected:
double _life;
double _velocity;
Vec2d _position;
double _damage;
double _distanceToEnd;
void reloadDistanceToEnd();
public:
Enemy(int nextPositionIndex);
virtual ~Enemy(){}
virtual bool tick();
virtual void draw(sf::RenderWindow* window) const {};
virtual void drawOver(sf::RenderWindow* window) const {};
virtual bool damage(double n);
virtual void killed();
double getLife() const { return _life ; }
double getVelocity() const { return _velocity; }
Vec2d getPosition() const { return _position; }
double getDamage() const { return _damage; }
int getNextPositionIndex() const { return _nextPositionIndex; }
int setNextPositionIndex(int nextPositionIndex);
double getDistanceToNextPosition() const;
double getDistanceToEnd() const;
};
#endif // ENEMY_H