Hi,
I am currently learning Object Orientated Programming and I am attempting to use an animation class that will be able to be used with every sprite which I will need in my game.
leftAnimation->setSpriteSheet(playerLeft);
void Animation::setSpriteSheet(const sf::Texture& texture)
{
m_texture = &texture;
}
The above line of code, throws the unhandled exception error taking me to the setSpritesheet function in the animation class.
In the load content function of the game.cpp this is how the playerLeft texture is loaded in.
if(!playerLeft.loadFromFile("left_spritesheet.png"))
{
std::cout << "Could not load texture from file" << std::endl;
}
I am a beginner trying to implement this class (
https://github.com/SFML/SFML/wiki/Source:-AnimatedSprite) to make my game object orientated and further understand how it works.
Can anyone please advise?
Many thanks,
starrybolt.