I'm trying to rebrand this cool Memory Game developed by Nate Wiley.
I'm having an issue with it though. When you win, it allows you to restart, but the game become unplayable when the cards re-appear for a second time.
The restart button code calls this function:
reset: function(){
this.hideModal();
this.shuffleCards(this.cardsArray);
this.setup();
this.$game.show();
},
This correctly hides the modal, shuffles the card, runs the setup function, and shows the game again.
The Setup Function looks like this:
setup: function(){
this.html = this.buildHTML();
this.$game.html(this.html);
this.$memoryCards = $(".card");
this.paused = false;
this.guess = null;
},
I'm not getting any errors in the console. How would I go about diagnosing an error in this situation?
I've created a codepen with only 2 matching pairs to make testing a lot quicker but I'm at a loss for how to figure this out.