Player.hpp 784 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #pragma once
  2. #include <SFML/Graphics.hpp>
  3. #include "AnimatedSprite.hpp"
  4. using namespace sf;
  5. struct Shared;
  6. class Player: public AnimatedSprite {
  7. public:
  8. Player() = delete;
  9. Player(Shared* context);
  10. virtual ~Player();
  11. void loop(float delta);
  12. void move(float x, float y);
  13. void move(float x);
  14. void animate() override;
  15. bool dead;
  16. public:
  17. Shared* _context;
  18. int _jumpDirection;
  19. float _velocity;
  20. Clock iframeclock;
  21. bool iframed;
  22. };
  23. class Corrupted: public Sprite {
  24. public:
  25. Corrupted() = delete;
  26. Corrupted(Shared* context);
  27. virtual ~Corrupted();
  28. void loop(float delta);
  29. bool dead;
  30. float speed;
  31. int hp;
  32. float xd;
  33. int lifespan;
  34. float out;
  35. float in;
  36. bool ready;
  37. private:
  38. Shared* _context;
  39. bool _direction;
  40. static Texture _tex;
  41. Clock _anclock;
  42. float height;
  43. };