forked from vittorioromeo/SSVOpenHexagon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CPlayer.h
42 lines (33 loc) · 825 Bytes
/
CPlayer.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
#ifndef CPLAYER_H_
#define CPLAYER_H_
#include "SSVEntitySystem.h"
#include "HexagonGame.h"
#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include "Config.h"
using namespace sf;
using namespace sses;
namespace hg
{
class CPlayer: public Component
{
private:
HexagonGame* hgPtr;
Vector2f pLeft, pRight;
Vector2f startPos, pos;
VertexArray vertices{PrimitiveType::Triangles, 3};
float hue{0};
bool isDead{false};
inline void drawPivot();
public:
float size{getPlayerSize()};
float angle{0};
float speed{getPlayerSpeed()};
float focusSpeed{getPlayerFocusSpeed()};
CPlayer(HexagonGame*, Vector2f);
void update(float mFrameTime) override;
void draw() override;
};
}
#endif /* CPLAYER_H_ */