im a c++ beginner and im trying to make a flappy game out of scratch, im doing good but don't know how to check input during the sleep function from window.h
while (GameStarted) {
std::cin >> answer;
Sleep(DurationOfATick);
system("CLS");
if (answer.size() != 1) {
Player.SetPosition(Player.GetPosition().x, Player.GetPosition().y - 1);
}
else {
Player.SetPosition(Player.GetPosition().x, Player.GetPosition().y + 1);
}
DrawFrame(Player, YPositionDrawn);
TicksCounted++;
std::cout << "Tick!" << TicksCounted << '\n';
}
I tried to add a std::cin << answer but for some reason it paused until it had a input, any help??