|
|
@ -20,16 +20,19 @@ void MoveLeft() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(lx < curpiece_->get_dim_x()){ // otherwise, nothing on this row
|
|
|
|
if(lx < curpiece_->get_dim_x()){ // otherwise, nothing on this row
|
|
|
|
ncpp::Cell b;
|
|
|
|
ncpp::Cell b;
|
|
|
|
int cmpy = ly, cmpx = lx - 1;
|
|
|
|
for(int xdelt = 1 ; xdelt < 3 ; ++xdelt){
|
|
|
|
curpiece_->translate(*board_, &cmpy, &cmpx);
|
|
|
|
int cmpy = ly, cmpx = lx - xdelt;
|
|
|
|
if(board_->get_at(cmpy, cmpx, &b)){
|
|
|
|
curpiece_->translate(*board_, &cmpy, &cmpx);
|
|
|
|
if(b.get().gcluster && b.get().gcluster != ' '){
|
|
|
|
if(board_->get_at(cmpy, cmpx, &b)){
|
|
|
|
return; // move is blocked
|
|
|
|
// FIXME deal with e.g. lower half sliding under upper half
|
|
|
|
|
|
|
|
if(b.get().gcluster && b.get().gcluster != ' '){
|
|
|
|
|
|
|
|
return; // move is blocked
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--x;
|
|
|
|
x -= 2;
|
|
|
|
if(!curpiece_->move(y, x) || !nc_.render()){ // FIXME needs y?
|
|
|
|
if(!curpiece_->move(y, x) || !nc_.render()){ // FIXME needs y?
|
|
|
|
throw TetrisNotcursesErr("move() or render()");
|
|
|
|
throw TetrisNotcursesErr("move() or render()");
|
|
|
|
}
|
|
|
|
}
|
|
|
|