Hello,
after a long time of doing a lot of stuff except programing, I´m back
Now I have a new computer and have everything set up new. I found in ne SFML dev-pack the source for an little pong game (quite funny) and wanted to add a few things, like a Gameloop. Because it´s really annoying to resart the whole game for a new round.
My problem is that I don´t know how to make it.
When now the game is finished, the source look like this
if (Ball.GetPosition().x < 0.f)
{
IsPlaying = false;
End.SetText("You lost !\n(press escape to exit)");
}
Ok, that IsPlaying = false; is the problem. I tried something like this:
Ball.SetPosition(400.f, 300.f);
sf::Sleep(0.5f);
Ball.Move(std::cos(BallAngle) * Factor, std::sin(BallAngle) * Factor);
But this doesn´t work.
I don´t no where the problem is - when the ball reachs one side of the screen, I set him into the middle and he moves again till he reaches one side of the screen.
So, does anybody know how solve this problem?
thanks in advance