You've made a bunch of newbie errors, I have put CHANGE at each row that I've changed for you.
*Remember to clear screen right before you redraw
*Keep the draw routine inside the App open routine, else it will just draw once.
*I don't know why you restricted the frame rate to just 10? I commented out anyway.
*You have to draw the background first, and then the other sprites. If you do as you did, you draw the players and then the background on top of them so the background will cover them.
*You never placed the background anywhere, usually you put it on coordinates 0,0.
*Make a habit of putting as much comments as possible in the code, it makes it a lot easier to follow
*I never bothered to do any other changes than to make the images visible, from now, you're on your own but you have the altered code below. I tested the code with random pictures from Internet and they displayed as expected.
------------------------------------------------------------------------------------------------------------
#include <iostream>
#include <SFML/System.hpp>
#include <SFML/Graphics.hpp>
using namespace std;
int main()
{
sf::Sprite Sprite; //Holds person image-person1 to 3
sf::Image person[3]; //Holds the 3 different person images
sf::RenderWindow App(sf::VideoMode(800, 600, 32),"Test");
int whichimage = 0; //start person with image 1?
sf:: Clock timer;
sf:: Event Event;
sf:: Sprite Sprite2; //Holds background
sf:: Sprite Sprite3; //Holds ground
sf:: Image background; //Is given to Sprite2
sf:: Image ground; //Is given to Sprite3
if(!person[0].LoadFromFile("person1.jpg")) {};
if(!person[1].LoadFromFile("person2.jpg")) {};
if(!person[2].LoadFromFile("person3.jpg")) {};
if(!background.LoadFromFile("background.jpg")) {};
if(!ground.LoadFromFile("ground.jpg")) {};
person[0].CreateMaskFromColor((sf::Color::White),0);
person[1].CreateMaskFromColor((sf::Color::White),0);
person[2].CreateMaskFromColor((sf::Color::White),0);
Sprite.SetImage(person[0]);
Sprite.SetPosition(50.f, 255.f);//Here starts the person
Sprite2.SetImage(background);
Sprite2.SetPosition(0.0f, 0.0f); //CHANGE added a place to draw background
Sprite3.SetImage(ground);
Sprite3.SetPosition(0.f, 548.f); //Here is the ground
// App.SetFramerateLimit(10); //CHANGE removed, maximum framerate? why 10???
while (App.IsOpened())
{ //App opened start
if (App.GetInput().IsKeyDown(sf::Key::Right))
{ //Right key start
Sprite.SetX(Sprite.GetPosition().x+10);
if(Sprite.GetPosition().x > 700)
{
Sprite.SetX(Sprite.GetPosition().x - 10);
}
if(Sprite.GetPosition().y > 400)
{
Sprite.SetX(Sprite.GetPosition().y - 10);//ground
}
if (timer.GetElapsedTime() >= 1.f)
{
go:
Sprite.SetImage(person[+1]);
if (++whichimage > 2)
{
whichimage = 0;
}
Sprite.SetImage(person[whichimage]);
timer.Reset();
}else{goto go;}
} //end of right key press
if (App.GetInput().IsKeyDown(sf::Key::Left))
{ //Begin left key press
Sprite.SetX(Sprite.GetPosition().x-10);
if(Sprite.GetPosition().x < -10)
{
Sprite.SetX(Sprite.GetPosition().x+10);
}
if(Sprite.GetPosition().y > 400)
{
Sprite.SetX(Sprite.GetPosition().y - 10);
}
if (timer.GetElapsedTime() >= 1.f)
{
go2:
Sprite.SetImage(person[+1]);
if (++whichimage > 2)
{
whichimage = 0;
}
Sprite.SetImage(person[whichimage]);
timer.Reset();
}else{goto go2;}
}//End of left key pressed
if(App.GetEvent(Event))
{
if (Event.Type == sf::Event::Closed)
App.Close();
}
App.Clear(sf::Color::White); //CHANGE added to the end of cykle
App.Draw(Sprite2); //Background
App.Draw(Sprite3); //Ground
App.Draw(Sprite); //Person CHANGE is drawn after ground and background
App.Display();
} //CHANGE, moved so the draw routine is within app opened
return 0;
}