-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlayer.h
84 lines (64 loc) · 1.82 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#ifndef PLAYER_H
#define PLAYER_H
#include <Zeni/Camera.h>
#include <Zeni/Collision.h>
#include <Zeni/Quaternion.h>
#include <Zeni/Vector3f.h>
namespace Crate {
class Player {
public:
Player(const Zeni::Camera &camera_,
const Zeni::Vector3f &end_point_b_,
const float radius_);
// Level 1
const Zeni::Camera & get_camera() const {return m_camera;}
// Level 2
void set_position(const Zeni::Point3f &position);
void adjust_pitch(const float &phi);
void turn_left_xy(const float &theta);
// Level 3
const Zeni::Collision::Capsule & get_body() const {return m_body;}
bool is_on_ground() const {return m_is_on_ground;}
const Zeni::Vector3f & get_velocity() const {return m_velocity;}
void set_velocity(const Zeni::Vector3f &velocity_) {m_velocity = velocity_;}
void set_on_ground(const bool &is_on_ground_);
void jump();
void port(const Zeni::Point3f &location_);
std::pair <Zeni::Point3f, Zeni::Vector3f> shoot();
//METHODS TO FLY AND REFUEL
void fly();
void fall();
bool can_fly();
void fuel_up();
float get_time();
bool resting();
float before;
float after;
void step(const float &time_step);
//being attacked
void attacked();
float get_health();
private:
void create_body();
// Level 1/2
Zeni::Camera m_camera;
// Level 2
Zeni::Vector3f m_end_point_b;
float m_radius;
// Level 3
Zeni::Collision::Capsule m_body; // collision
Zeni::Vector3f m_velocity;
bool m_is_on_ground;
// Level 4
// Controls are external to Player
//Timer for jetpack fuel and recharge
Zeni::Chronometer<Zeni::Time> rest_timer;
Zeni::Chronometer<Zeni::Time> fly_timer;
Zeni::Chronometer<Zeni::Time> no_move;
float fuel;
float rest_time;
float in_air_time;
float health;
};
}
#endif