Skip to content

Instantly share code, notes, and snippets.

@TheOpenDevProject
Created March 25, 2016 09:31
Show Gist options
  • Save TheOpenDevProject/f9529def62e9fa75162a to your computer and use it in GitHub Desktop.
Save TheOpenDevProject/f9529def62e9fa75162a to your computer and use it in GitHub Desktop.
//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