Perso.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #ifndef PERSO_H
  2. #define PERSO_H
  3. // Base
  4. #include <iostream>
  5. #include <cmath>
  6. // Affichage
  7. #include "../Structures/SDL_rotozoom.h"
  8. #include "../Structures/Affichable.h"
  9. #include "DisplayHP.h"
  10. // Mouvement
  11. #include "../Structures/Vecteur.h"
  12. #include "../Control/Controler.h"
  13. // Tirs
  14. #include "../Tirs/Tirs_Gest.h"
  15. #include "../Armes/Armes_Gest.h"
  16. class Perso : public Affichable
  17. {
  18. /// Fonctions - - -
  19. public:
  20. Perso(SDL_Surface* srcImg, SDL_Surface* deathImg, Controler* ctrl, Tirs_Gest* tirsGest, bool allie, Armes_Gest* armGest);
  21. Perso(SDL_Surface* srcImg, SDL_Surface* deathImg, Controler* ctrl, Tirs_Gest* tirsGest, bool allie, Armes_Gest* armGest, float x, float y);
  22. virtual ~Perso();
  23. void bouger();
  24. bool estVivant() const;
  25. Vec getPos() const;
  26. Vec getVisee() const;
  27. void regen();
  28. void virtual afficher(const Vec &lookAt, SDL_Surface* screen);
  29. protected:
  30. void majFullImg();
  31. /// Attributs - - -
  32. protected:
  33. // Vie
  34. int m_vieMax;
  35. int m_vie;
  36. DisplayHP m_disHP;
  37. // Physique
  38. float m_vitesse;
  39. bool m_vivant;
  40. const bool m_allie;
  41. // Surfaces
  42. SDL_Surface* m_srcImg;
  43. SDL_Surface* m_deathImg;
  44. SDL_Surface* m_fullImg;
  45. // Visée
  46. Vec m_visee;
  47. Vec m_ortho;
  48. Controler* m_ctrl;
  49. // Pour encaisser
  50. Tirs_Gest* m_tirsGest;
  51. // Pour tirer
  52. Armes_Gest* m_armGest;
  53. Arme* m_arme[2];
  54. };
  55. #endif // PERSO_H