MichaelPachec0 / nodejs-project-night

Project night for May 27 2022
MIT License
5 stars 12 forks source link

checking for card match function created in object #36

Closed SarahMelki closed 2 years ago

SarahMelki commented 2 years ago

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.

jericashall commented 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?

SarahMelki commented 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?

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.

SarahMelki commented 2 years ago

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; }

SarahMelki commented 2 years ago

I did the required changes but not sure where all the red 'checks have failed' are coming from. I followed all the steps though 😨

jericashall commented 2 years ago

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.

MichaelPachec0 commented 2 years ago

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.

MichaelPachec0 commented 2 years ago

@SarahMelki i have kept both your pr's code and current. this should be ready for review now.