do while loops

I haven't done to much with do while loops but i want this do while loop to end when either the players health = 0 or alien health = 0



do
{


} while (health = 0 | alien_health = 0);
you want it to run while their health is not equal to zero so it should be
do{

}while(health!=0 && alien_health !=0)
this way if either health or alien health hits 0 (I assume you will not be going into the negatives) the loop will terminate
thank you so much
Topic archived. No new replies allowed.