mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-10 01:29:05 -04:00
tetris: factor out MoveLateral()
This commit is contained in:
parent
37b5564722
commit
2852ff736c
@ -1,19 +0,0 @@
|
||||
void MoveRight() {
|
||||
const std::lock_guard<std::mutex> lock(mtx_);
|
||||
int y, x;
|
||||
if(PrepForMove(&y, &x)){
|
||||
if(!curpiece_->move(y, x + 2)){
|
||||
throw TetrisNotcursesErr("move()");
|
||||
}
|
||||
if(InvalidMove()){
|
||||
if(!curpiece_->move(y, x)){
|
||||
throw TetrisNotcursesErr("move()");
|
||||
}
|
||||
}else{
|
||||
x += 2;
|
||||
if(!nc_.render()){
|
||||
throw TetrisNotcursesErr("render()");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user