You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
notcurses/src/tetris/ticker.h

17 lines
352 B
C++

void Ticker() { // FIXME ideally this would be called from constructor :/
std::chrono::milliseconds ms;
do{
mtx_.lock();
ms = msdelay_;
mtx_.unlock();
std::this_thread::sleep_for(ms);
ncmtx.lock();
if(MoveDown()){
gameover_ = true;
ncmtx.unlock();
return;
}
ncmtx.unlock();
}while(!gameover_);
}