Bug with clicking the same card
Closed this issue · 4 comments
Found a bug. If you keep clicking the same card over and over again, you win the game. Let's say you click the first card, then again click the same card, the game sees it as a "Match". Keep clicking the same card over and over again. Game will see it as 8 correct matches and you win the game without opening more than a single card
wow. Thank you for issuing this bug. I will fix it 😊
No worries. I am learning basic html, javascript etc. I am starting by looking at existing projects. Your project helped me. I have uploaded it in my repository with the bug fix. In my repository, i have your projects with some changes - i have fixed the bug. I have also added a timer.
I am now working on making it responsive. So that if screen size shrinks, it shrinks along with it. Let me know if you have ideas about making it responsive.
After line 99 in your index.js, in the addcardlistener function, if you add foloowing line, it will fix the bug -
if($('.show').length > 1) { return true; }
Thanks again
You can take a look at the CSS Framework: Bootstrap, It is very handy to make the page responsive
Or you can check out this guide for learning css layout