61
General / Re: sf::clock not working (or maybe I am being stupid)
« on: August 17, 2012, 12:22:46 am »
Shouldn't it be movementloop == true? movementloop = true would mean that you set movementloop to true, I believe, same with movementloop2 = true should be movemementloop2 == true.
Also why are you using movementloop and movementloop2?
Wouldn't it be easier to do it like this
Also I would recommend altering the calling of movementloop = true; to something like this
this would make sure that movementloop would only be switched to true when the Invader reaches the screenborder (you would have to define SCREENEDGE first of course)
Do the same in both loops and it should work.
... Also, listen to eXpl0iter
Also why are you using movementloop and movementloop2?
Wouldn't it be easier to do it like this
while (movementloop == true
{
//do somethingelse
}
while (movementloop == false)
{
// do something else
}
{
//do somethingelse
}
while (movementloop == false)
{
// do something else
}
Also I would recommend altering the calling of movementloop = true; to something like this
if (Invader1Sprite.GetPosition > SCREENEDGE) movementloop = true
this would make sure that movementloop would only be switched to true when the Invader reaches the screenborder (you would have to define SCREENEDGE first of course)
Do the same in both loops and it should work.
... Also, listen to eXpl0iter