Created
March 25, 2016 09:31
-
-
Save TheOpenDevProject/f9529def62e9fa75162a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//main.cpp | |
#include "gamestage.h" | |
int main() | |
{ | |
GameStage theGame; | |
theGame.startGame(); | |
return 0; | |
} | |
//gamestage.h | |
#ifndef GAMESTAGE_H | |
#define GAMESTAGE_H | |
#include <SFML/Graphics.hpp> | |
#include <memory> | |
class GameStage | |
{ | |
public: | |
GameStage(); | |
void startGame() const; | |
private: | |
std::unique_ptr<sf::RenderWindow> gameWindow; | |
}; | |
#endif // GAMESTAGE_H | |
//playerentity.h | |
#ifndef PLAYERENTITY_H | |
#define PLAYERENTITY_H | |
#include <SFML/Graphics.hpp> | |
class PlayerEntity : public sf::Drawable | |
{ | |
public: | |
PlayerEntity(); | |
virtual void draw(sf::RenderTarget &target, sf::RenderStates states) const; | |
void tick(); | |
private: | |
sf::Vector2f _playerPos; | |
sf::CircleShape _player; | |
}; | |
#endif // PLAYERENTITY_H |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment