Closed SarahMelki closed 2 years ago
This looks good. Mire is working on the card flipping, so you can comment that section out.
Can you explain this function getCardType(card) { return card.getElementsByClassName('squirtle')[0].src; } Should it always be checking 0 index instead of the cards index?
This looks good. Mire is working on the card flipping, so you can comment that section out.
Can you explain this function getCardType(card) { return card.getElementsByClassName('squirtle')[0].src; } Should it always be checking 0 index instead of the cards index?
Yup, so since it's only one card grabbed from the top of the array, (we need to get the value from the front face + using a class for this value, which I think after the changes should be 'dance' not 'squirtle') hence it's the card at index 0.
I missed adding a function when I was saving my work from the draft file!! An important function for the mis-matched cards:
cardMismatch(card1, card2) { this.active = true; card1.classList.remove('visible'); card2.classList.remove('visible'); this.active = false; }
I did the required changes but not sure where all the red 'checks have failed' are coming from. I followed all the steps though 😨
Sarah I think you should close this pull request, make sure you've pulled the lasted committed changes into your repository and then open another pull request.
I did the required changes but not sure where all the red 'checks have failed' are coming from. I followed all the steps though 😨
Sorry for not being too active, I'll try and see what I can do on getting this PR ready to merge.
@SarahMelki i have kept both your pr's code and current. this should be ready for review now.
25 created a class with methods to check for matching cards. There are a couple other methods that could be deleted based on who is tackling them like shuffleCards, canFlipCard and flipCard.