StateIngame.hpp 794 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #pragma once
  2. #include <SFML/Graphics.hpp>
  3. #include <tmxlite/Map.hpp>
  4. #include "SFMLOrthogonalLayer.hpp"
  5. #include "State.hpp"
  6. #include "Player.hpp"
  7. #include "Spectre.hpp"
  8. #define LAYER_COUNT 6
  9. class StateIngame: public State {
  10. public:
  11. StateIngame();
  12. virtual ~StateIngame();
  13. void reset();
  14. void onEvent(sf::Event event) final;
  15. void onUpdate(float dt) final;
  16. void onRender() final;
  17. State* next() const final;
  18. private:
  19. bool m_paused { false };
  20. sf::Clock m_global_clock;
  21. Player m_player;
  22. sf::Sound m_music;
  23. sf::Sprite m_background;
  24. sf::Sprite m_vignette;
  25. tmx::Map m_map;
  26. tmx::Map m_map2;
  27. std::array<MapLayer, LAYER_COUNT * 2> m_layer;
  28. std::vector<Spectre*> m_spectres;
  29. std::vector<Spectre::Settings> m_spectre_list;
  30. sf::Sound m_snd;
  31. sf::Music m_wind;
  32. sf::Music m_brown;
  33. };