Skip to content

Instantly share code, notes, and snippets.

@melcor76

melcor76/main.js Secret

Last active September 12, 2020 15:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save melcor76/3b40e2fbbcd2fb8d1985ff5c794bf96b to your computer and use it in GitHub Desktop.
Save melcor76/3b40e2fbbcd2fb8d1985ff5c794bf96b to your computer and use it in GitHub Desktop.
js-tetris main play
function play() {
board.reset();
let piece = new Piece(ctx);
piece.draw();
board.piece = piece;
}
@ozgurkaragoz
Copy link

ozgurkaragoz commented Dec 7, 2019

It's not working without "board.piece = piece;"

function play() {
  board = board.getEmptyBoard();
  let piece = new Piece(ctx);
  piece.draw();

  board.piece = piece;
}

@melcor76
Copy link
Author

melcor76 commented Dec 8, 2019

OK, thanks @ozgurkaragoz!

@KeksKlip
Copy link

The working version is

function play() {
  board.getEmptyBoard();
  let piece = new Piece(ctx);
  piece.draw();

  board.piece = piece;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment