mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-10 01:29:05 -04:00
Tetris: place new pieces on mults of 2 #421
This commit is contained in:
parent
b7c9746cf0
commit
5864b37d0a
@ -18,7 +18,7 @@ std::unique_ptr<ncpp::Plane> NewPiece() {
|
||||
const size_t cols = strlen(t->texture);
|
||||
int y, x;
|
||||
stdplane_->get_dim(&y, &x);
|
||||
const int xoff = x / 2 - BOARD_WIDTH + random() % BOARD_WIDTH;
|
||||
const int xoff = x / 2 - BOARD_WIDTH + 2 * (random() % (BOARD_WIDTH / 2));
|
||||
std::unique_ptr<ncpp::Plane> n = std::make_unique<ncpp::Plane>(2, cols, board_top_y_ - 1, xoff, nullptr);
|
||||
if(n){
|
||||
uint64_t channels = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user