Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (this.tilesChecked.length === 2) {
- this.canGet = false;
- if (
- this.tilesChecked[0].dataset.cardType ===
- this.tilesChecked[1].dataset.cardType
- ) {
- setTimeout(this.deleteTiles.bind(this), 500);
- } else {
- setTimeout(this.resetTiles.bind(this), 500);
- }
- this.moveCount++;
- this.divScore.innerText = this.moveCount;
- }
- }
- },
- deleteTiles: function() {
- this.tilesChecked[0].remove();
- this.tilesChecked[1].remove();
- this.canGet = true;
- this.tilesChecked = [];
- this.tilePairs++;
- if (this.tilePairs >= this.tileCount / 2) {
- alert('gameOver!');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement