Tetris: clear out lines #421

pull/426/head
nick black 5 years ago
parent 1cd9ec2b31
commit 4afa02a44f
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -22,7 +22,7 @@ void LockPiece(){
} }
cleared = 0; cleared = 0;
int y; int y;
for(y = bdimy - 2 ; y > 0 ; --y){ for(y = bdimy - 2 ; y > 0 ; --y){ // get the lowest cleared area
if(LineClear(y)){ if(LineClear(y)){
++cleared; ++cleared;
}else if(cleared){ }else if(cleared){
@ -36,7 +36,11 @@ void LockPiece(){
if(board_->get_at(dy, x, &c) < 0){ if(board_->get_at(dy, x, &c) < 0){
throw TetrisNotcursesErr("get_at()"); throw TetrisNotcursesErr("get_at()");
} }
if(board_->putc(dy + 1, x, &c) < 0){ if(board_->putc(dy + cleared, x, &c) < 0){
throw TetrisNotcursesErr("putc()");
}
c.get().gcluster = 0;
if(board_->putc(dy, x, &c) < 0){
throw TetrisNotcursesErr("putc()"); throw TetrisNotcursesErr("putc()");
} }
} }

Loading…
Cancel
Save