Game.hpp 700 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #ifndef _ASTEROID_GAME_HPP_
  2. #define _ASTEROID_GAME_HPP_
  3. #include <SFML/Graphics.hpp>
  4. #include <list>
  5. #include <asteroid/Player.hpp>
  6. class Game
  7. {
  8. private:
  9. sf::RenderWindow* window;
  10. Player player;
  11. std::list<sf::RectangleShape*> asteroids;
  12. std::list<sf::RectangleShape*> shoots;
  13. void processEvents();
  14. void checkCollisions();
  15. void update();
  16. void draw();
  17. void moveAsteroids();
  18. void moveShoots();
  19. //Helper functions should be encapsulated better
  20. //Low level parts should be in another class
  21. void drawRectangleShapes(std::list<sf::RectangleShape*> shapes);
  22. bool quit = false;
  23. public:
  24. Game(sf::RenderWindow* window);
  25. void run();
  26. };
  27. #endif //_ASTEROID_GAME_HPP_