Skip to content

Instantly share code, notes, and snippets.

@ZachMassia
Last active December 15, 2015 13:09
Show Gist options
  • Save ZachMassia/5265525 to your computer and use it in GitHub Desktop.
Save ZachMassia/5265525 to your computer and use it in GitHub Desktop.
Game::Game() : player(createPlayer()) {}
Game::~Game() {}
Sprite Game::createPlayer()
{
if (images.get("imageKey") == nullptr) {
images.load("imageKey", "imageFilename.png");
}
Sprite temp(images.get("imageKey"));
return temp;
}
class Game
{
private:
Sprite player;
AssetManager images;
public:
Game();
~Game();
Sprite createPlayer();
}
class Sprite
{
private:
Texture* texture;
public:
Sprite(Texture* _texture) : texture(_texture) {}
virtual ~Sprite() {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment