current problemOk so my issue is when I change the color, I lose even if I don't touch anything
here is the code for that:
while (MainWindow.pollEvent(Event)){
if (Event.type == sf::Event::KeyReleased){
if (Event.key.code == sf::Keyboard::D){
if (PlayerColor == Blue){
BlueScore++;
ChooseNextPlayer();
}
if (PlayerColor == Pink){
GameOver();
}
}
if (Event.key.code == sf::Keyboard::A){
Player.move(10, 0);
if (PlayerColor == Pink){
PinkScore++;
ChooseNextPlayer();
}
if (PlayerColor == Blue){
GameOver();
}
}
}
void ChooseNextPlayer(){
if (Lose == false){
srand(time(0));
NumberChosen = 1 + (rand() % 2);
if (NumberChosen == 1){
PlayerColor = Pink;
}
if (NumberChosen == 2){
PlayerColor = Blue;
}
std::cout << NumberChosen << std::endl;
}
}
if you need anything else of my code to help please just ask