I'm having a problem with an if
statement which has an or
in it as well. I am essentially trying to have it so that if either of the player's score is 50, the game ends.
I'm trying to have my code saying something like this:
if ball.score2 or ball.score1 == 50:
EndGame()
However, when I have this, as soon as the thing which ups ball.score2
(but this only happens for whichever one is first in the if
statement, so here it does not do it if ball.score1
is upped) happens, and it is meant to be upped by 5, it runs the EndGame()
. They work individually, so if I have:
if ball.score2 == 50:
EndGame()
It will end the game when ball.score2
gets to 50, but not when I use them both like in the first example. Could someone help?