boring12345 / Memory

This is the repository for the Codecademy Memory project.
http://boring12345.github.com/Memory/
11 stars 8 forks source link

fast clicking or setTimeout() #46

Closed haxor789 closed 11 years ago

haxor789 commented 11 years ago

The problem is that while the 800ms of the setTimeout part are ticking, you can still trigger the click handler of the cards, that leads to problems, e.g. if you click fast on different cards you could "skip" 1-2 players turns. One could shorten the time or make an alert "its your turn player x", but these are rather annoying solution does anyone know a better one?

haxor789 commented 11 years ago

I think I fixed this problem with a new lock variable. What do you like better:

or

boring12345 commented 11 years ago

I think the cards should turn around without clicking, so I'm for the first one.

haxor789 commented 11 years ago

I'd extend the time for the first to 1s (if there are no sideeffects i yet not recognized) and try to find a smoother fade out sequence. The second one has the huge advantage to take as much time as you need to memorize, but the clicking might be annoying if you play fast.

To change it simply replace counter with hiddenCounter(cardsHidden) in the if statement. Maybe one could ask this question again after some beta testers.

boring12345 commented 11 years ago

Okay. :-)

boring12345 commented 11 years ago

I think this is done, isn't it? ;-)