37 Player(
RenderWindow *window,
double *position_x,
double *position_y,
double *direction_x,
double *direction_y,
double *plane_x,
double *plane_y, std::vector<std::vector<int>> *world_map, json *sprite, std::vector<Enemy *> *enemies);
46 void handle_input(
const Uint8 *inkeys,
double frameTime);
72 void hit(
double damage);
111 SDL_GameController *controller = NULL;
112 SDL_Haptic *haptic = NULL;
114 double controller_tolerance = 0.3;
116 double controller_trigger_tolerance = 0.5;
118 double speed_multiplier = 2;
130 double damage_buffer = 0;
134 std::vector<Sample *> sound_player_pain;
137 bool taking_damage =
false;
140 double previous_time = 0.0;
142 double pain_timer = 0.0;
145 std::vector<std::vector<int>> *world_map;
149 std::vector<Enemy *> *enemies;
Definition: pistol.hpp:18
Definition: player.hpp:19
std::vector< std::vector< int > > * get_world_map()
Get the world map.
Definition: player.cpp:287
double get_health()
Get the Player's health.
Definition: player.cpp:255
double * get_position_x()
Get the Player's position x.
Definition: player.cpp:281
void clear_buffer_damage()
Clear the accumulated damage.
Definition: player.cpp:277
double * get_position_y()
Get the Player's position y.
Definition: player.cpp:284
void hit()
Removes the buffered damage from the Player's health, plays the hurt sound effect and displays a red ...
Definition: player.cpp:259
Player(RenderWindow *window, double *position_x, double *position_y, double *direction_x, double *direction_y, double *plane_x, double *plane_y, std::vector< std::vector< int >> *world_map, json *sprite, std::vector< Enemy * > *enemies)
Construct the Player object.
Definition: player.cpp:3
void handle_input(const Uint8 *inkeys, double frameTime)
Handles the input for the Player, uses both keyboard and a controller.
Definition: player.cpp:68
void buffer_damage(double damage)
Accumulates damage which can be then dealt with hit()
Definition: player.cpp:274
void render()
Renders the Player's elements and it's children's elements.
Definition: player.cpp:234
Definition: renderwindow.hpp:16
Definition: sample.hpp:18
Contains the header functions for the Enemy Class.
Contains the header functions for the Pistol Class.
Contains the header functions for the RenderWindow Class.
Contains the header functions for the Enemy Class.