-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlayer.h
51 lines (41 loc) · 794 Bytes
/
Player.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
// Player.h
// Player (nyancat) class
#include <vector>
#ifdef __APPLE__
# include <stdint.h>
#else
# include <cstdint>
#endif
#ifdef __APPLE__
# include <GLUT/glut.h>
#else
# include <GL/glut.h>
#endif
struct Point {
float x;
float z;
};
class Player {
public:
static const float RIGHT;
static const float TOP;
static const float BOT;
static const float FWD;
static const float BACK;
bool collided;
float playerColor[3];
uint8_t direction;
std::vector<Point> positions;
void turn(bool);
void draw();
Point tick();
Player(GLuint *, GLuint *);
Player(float, float, uint8_t, GLuint *, GLuint *);
private:
GLuint *texFrames;
GLuint *rainbowTex;
unsigned int frameCount;
void init(float, float, uint8_t, GLuint *, GLuint *);
void drawCat();
void drawTrail();
};