The seperate class to load, display and destroy the sprites is my form a Sprite Manager class, instead of having a wall of text in the main main.cpp file that loads all the files in I want to move it to another class and call that method (sorry I think I used the word function incorrectly in my last post) just as a way to sort the code up visually and mentally. The class will have a seperate methods to handle displaying at the end of the loop and then kill the images once the loop has ended completely. Not during the loop
Also my bad about the snippit of code that is showing the sprite to texture bit. I left out a line, embarassing :S
It should be edited back in now but incase it isnt here is the revised version
sf::Texture paddle; // Here is the missing line if(!paddle.loadFromFile("Paddle.png")) std::cout << "Could not load paddle." << std::endl; sf::Sprite sPaddle; sPaddle.setTexture(paddle);
I have not taken an official programming language courses so my terminoligy is unsurprisingly poor, all my knowledge comes from free online help all over the web. Good to know though!
sPaddle.setPosition(0, SCREENHEIGHT/2 - (PADDLEHEIGHT/2)); // Line 31
And ther Error message that is coming up in the build log is saying
|31|error: 'sPaddle' was not declared in this scope|