-
Notifications
You must be signed in to change notification settings - Fork 1
/
player.h
61 lines (56 loc) · 1.12 KB
/
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
51
52
53
54
55
56
57
58
59
60
#ifndef _DFGAME_PLAYER_H_
#define _DFGAME_PLAYER_H_
#include "object.h"
#include "stdio.h"
#include "platform.h"
#include "globals.h"
#include "level.h"
#define PLAYER_WIDTH 100
#define PLAYER_HEIGHT 100
class Player: public GameObject {
private:
Texture* texLeft;
Texture* texRight;
Texture* texFront;
Texture* texRightJump;
Texture* texLeftJump;
float x;
float y;
float speed;
float health;
Vect2D accel;
Vect2D v;
Level *level;
bool left;
bool right;
bool collides();
bool colliding;
public:
bool singleCollide(GameObject *);
void setLevel(Level *);
void doMovement(float);
Player();
Player(Texture*,Texture*,Texture*,Texture*,Texture*);
virtual void setPosition(float, float);
void setX(float);
void setY(float);
virtual void move(float, float);
virtual float getX();
virtual float getY();
float getSpeed();
void setSpeed(float);
float getHealth();
void setHealth(float);
virtual void draw();
void moveLeft();
void moveRight();
void moveUp();
void moveDown();
void stopLeft();
void stopRight();
void jump();
void stopX();
virtual float getHeight();
virtual float getWidth();
};
#endif