1234567891011121314151617181920212223242526272829303132333435363738394041 |
- #ifndef _ASTEROID_GAME_HPP_
- #define _ASTEROID_GAME_HPP_
- #include <SFML/Graphics.hpp>
- #include <list>
- #include <asteroid/Player.hpp>
- class Game
- {
- private:
- sf::RenderWindow* window;
- Player player;
- std::list<sf::RectangleShape*> asteroids;
- std::list<sf::RectangleShape*> shoots;
- void processEvents();
- void checkCollisions();
- void update();
- void draw();
- void moveAsteroids();
- void moveShoots();
- //Helper functions should be encapsulated better
- //Low level parts should be in another class
- void drawRectangleShapes(std::list<sf::RectangleShape*> shapes);
- bool quit = false;
- public:
- Game(sf::RenderWindow* window);
- void run();
- };
- #endif //_ASTEROID_GAME_HPP_
|