Skip to content

Instantly share code, notes, and snippets.

@TheOpenDevProject
Created December 27, 2015 13:51
Show Gist options
  • Save TheOpenDevProject/6c373504dd5e70252402 to your computer and use it in GitHub Desktop.
Save TheOpenDevProject/6c373504dd5e70252402 to your computer and use it in GitHub Desktop.
std::vector<sf::Sprite*> getCharacterCryWalk(){
//Load all textures into memory
sf::Texture *walkState = new sf::Texture;
sf::Texture *walkState_2 = new sf::Texture;
sf::Texture *walkState_3 = new sf::Texture;
sf::Texture *walkState_4 = new sf::Texture;
walkState->loadFromFile("walk1_0.png");
walkState_2->loadFromFile("walk1_1.png");
walkState_3->loadFromFile("walk1_2.png");
walkState_4->loadFromFile("walk1_3.png");
std::vector<sf::Sprite*> Character_0;
sf::Sprite *State_0 = new sf::Sprite();
State_0->setTexture(*walkState);
State_0->setTextureRect(sf::IntRect(0,0,76,74));
Character_0.push_back(State_0);
sf::Sprite *State_1 = new sf::Sprite();
State_1->setTexture(*walkState_2);
State_1->setTextureRect(sf::IntRect(0,0,76,74));
Character_0.push_back(State_1);
sf::Sprite *State_2 = new sf::Sprite();
State_2->setTexture(*walkState_3);
State_2->setTextureRect(sf::IntRect(0,0,76,74));
Character_0.push_back(State_2);
sf::Sprite *State_3 = new sf::Sprite();
State_3->setTexture(*walkState_4);
State_3->setTextureRect(sf::IntRect(0,0,76,74));
Character_0.push_back(State_3);
return Character_0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment