/GUIPanel.h

http://github.com/adamldoyle/Snake · C Header · 29 lines · 24 code · 5 blank · 0 comment · 0 complexity · b0ad1c7c76c30cbb05caad7cfe16b8e1 MD5 · raw file

  1. #ifndef GUIPANEL_H
  2. #define GUIPANEL_H
  3. #include <SFML/Graphics.hpp>
  4. #include "Common.h"
  5. #include "Snake.h"
  6. class GUIPanel : public sf::Drawable
  7. {
  8. public:
  9. GUIPanel(sf::FloatRect rect);
  10. virtual ~GUIPanel();
  11. void update(Snake& snake);
  12. void reset();
  13. protected:
  14. virtual void Render(sf::RenderTarget& target, sf::Renderer& renderer) const;
  15. private:
  16. sf::Shape m_background;
  17. sf::Shape m_border;
  18. int m_nPlayerScore;
  19. int m_nSnakeLength;
  20. static const int FOOD_BONUS = 200;
  21. static const int TIME_BONUS = 1;
  22. static const int PIECES_PER_TIME_BONUS = 5;
  23. };
  24. #endif // GUIPANEL_H