Last active
December 15, 2015 13:09
-
-
Save ZachMassia/5265525 to your computer and use it in GitHub Desktop.
This file contains 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
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; | |
} |
This file contains 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
class Game | |
{ | |
private: | |
Sprite player; | |
AssetManager images; | |
public: | |
Game(); | |
~Game(); | |
Sprite createPlayer(); | |
} |
This file contains 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
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