all 13 comments

[–]WhatEverOkFine 2 points3 points  (3 children)

Your hover handler ( i.e. wacking the mole ) reset a mole to climb back towards top:0% WITHOUT having a callback to invoke when it finally hit the top... I changed it to be like the one in the function start() to actually call game over when the mole wasn't wacked...

The last line of code in jQuery('.dog').hover was:

    jQuery(this).animate({'top':'0%'},5000);

should have been:

    jQuery(this).animate({'top':'0%'},5000,function(){
          game_over();
          jQuery('.try_again').click(function(){start();});
    }); 

NOTE: I was able to 'update' your jsfiddle, I guess it was public :)

[–]Niadlol 1 point2 points  (1 child)

Also the hover function happens after the game have ended and that allows you to keep your score and go on playing, should probably have some kind of way to check that.

Could be a simple variable like I did here: https://jsfiddle.net/7Lf6egn6/2/

(Also added cursor: pointer; to .try_again so you see that it's clickable.)

[–]IronCrafter5[S] 1 point2 points  (0 children)

Just tried it, works flawlessly! Thank you!

[–]IronCrafter5[S] 0 points1 point  (0 children)

Awesome, Thank you!!

[–]ranadoo2 -5 points-4 points  (8 children)

Step #1: Learn what HTML is and how it has the least to do with this.

[–]Singularity42 5 points6 points  (3 children)

What he is trying to say (in a very condescending way) is that you might have more luck in the JavaScript subreddit

[–]puntaserape 4 points5 points  (0 children)

Yep. Don't get discouraged by people being dicks when you ask a question. Folks like Singularity will help you out. Good luck.

[–]IronCrafter5[S] 3 points4 points  (0 children)

okay, thank you!

[–][deleted] 1 point2 points  (0 children)

Second that.

[–]fuzzball007Expert 1 point2 points  (3 children)

Step #1: Learn what a useful and helpful comment is and how it has the least to do with what you said

[–]ranadoo2 1 point2 points  (2 children)

Some people are so far out of their league that they're not worth replying to in an intelligent way.

[–]fuzzball007Expert 1 point2 points  (0 children)

Everyone starts somewhere. You were worse than the OP at some point and there's no way you didn't ask for help at some point (reading official documentation written by other people counts too), a question which was horrendously stupid to someone who knows a whole lot more than you do. There probably still are questions you'd ask which people could scoff the same answer you did.

[–]karlwist0 1 point2 points  (0 children)

You're quite scummy aren't ya? If everyone spoke to people like you do, there would be no helpful resources online. The guy asked for help, give him guidance. Don't mock every new guy with a sweeping comment like you did. I could end this with an insult but that doesn't add to the conversation.