|
|
| Weapon () |
| | Construct the Weapon object.
|
| |
| int | get_magazine () |
| | Get the Weapon's magazine. More...
|
| |
| void | set_magazine (int value) |
| | Set the Weapon's magazine. More...
|
| |
| int | get_capacity () |
| | Get the Weapon's capacity (clip) More...
|
| |
| void | set_capacity (int value) |
| | Set the Weapon's capacity (clip) More...
|
| |
| void | set_weapon_specifications (std::vector< SDL_Texture * > texture, int fire_frame=3, int fire_cooldown=0.75, int max_fire_distance=6) |
| | Set the Weapon's specifications. More...
|
| |
| void | set_audio (Sample *sample) |
| | Set the Weapon's fire sound effect. More...
|
| |
| void | fire (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, SDL_Haptic *haptic=NULL) |
| | Fire the Weapon. More...
|
| |
| void | render (RenderWindow *window) |
| | Render the weapon to the renderer. More...
|
| |
◆ fire()
| void Weapon::fire |
( |
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, |
|
|
SDL_Haptic * |
haptic = NULL |
|
) |
| |
Fire the Weapon.
- Parameters
-
| position_x | The Player's Position X |
| position_y | The Player's Position Y |
| direction_x | The Player's Direction X |
| direction_y | The Player's Direction Y |
| plane_x | The Camera's Plane X |
| plane_y | The Camera'S Plane Y |
| world_map | The vector of the world map |
| sprite | The "vector" of sprites |
| enemies | The vector of enemies |
| haptic | The controller's haptic feedback for when the Weapon fires |
◆ get_capacity()
| int Weapon::get_capacity |
( |
| ) |
|
Get the Weapon's capacity (clip)
- Returns
- int
◆ get_magazine()
| int Weapon::get_magazine |
( |
| ) |
|
Get the Weapon's magazine.
- Returns
- int
◆ render()
Render the weapon to the renderer.
- Parameters
-
◆ set_audio()
| void Weapon::set_audio |
( |
Sample * |
sample | ) |
|
Set the Weapon's fire sound effect.
- Parameters
-
◆ set_capacity()
| void Weapon::set_capacity |
( |
int |
value | ) |
|
Set the Weapon's capacity (clip)
- Parameters
-
| value | Value to set the Weapon's capacity (clip) to |
◆ set_magazine()
| void Weapon::set_magazine |
( |
int |
value | ) |
|
Set the Weapon's magazine.
- Parameters
-
| value | Value to set the Weapon's magazine to |
◆ set_weapon_specifications()
| void Weapon::set_weapon_specifications |
( |
std::vector< SDL_Texture * > |
texture, |
|
|
int |
fire_frame = 3, |
|
|
int |
fire_cooldown = 0.75, |
|
|
int |
max_fire_distance = 6 |
|
) |
| |
Set the Weapon's specifications.
- Parameters
-
| texture | Vector of the frames of the Weapon |
| fire_frame | The frame (0,1,2,..) of the texture of when the Weapon has "fired", example of when the muzzle flash is showing |
| fire_cooldown | Weapon's fire cooldown in seconds before it can shoot again |
| max_fire_distance | The Weapon's maximum fire range |
The documentation for this class was generated from the following files: