I suggest you to add this symbol with a #define directive:
#define PI 3.14159265f
You can also change this code:
Vector2f PosPerso = spaceship.GetPosition();
if(PosPerso.x<16)
{
PosPerso.x=16;
spaceship.SetPosition(PosPerso.x, PosPerso.y);
}
if(PosPerso.y<16)
{
PosPerso.y=16;
spaceship.SetPosition(PosPerso.x, PosPerso.y);
}
if(PosPerso.x>(LARGEURECRAN))
{
PosPerso.x=LARGEURECRAN;
spaceship.SetPosition(PosPerso.x, PosPerso.y);
}
if(PosPerso.y>(HAUTEURECRAN))
{
PosPerso.y=HAUTEURECRAN;
spaceship.SetPosition(PosPerso.x, PosPerso.y);
}
with this:
if (spaceship.GetPosition().x < 16.f) spaceship.SetX(16.f);
if (spaceship.GetPosition().y < 16.f) spaceship.SetY(16.f);
if (spaceship.GetPosition().x > LARGEURECRAN) spaceship.SetX(LARGEURECRAN);
if (spaceship.GetPosition().y > HAUTEURECRAN) spaceship.SetY(HAUTEURECRAN);
As you can note, there are two methods to access X and Y coords of a sf::Sprite directly: SetX(), SetY()
Easier, isn't it?
Anyway I'm curious to test your game!