ga-wdi-exercises / project1

[project] GA- Project 1
3 stars 75 forks source link

I need to setup Set Timeout Correctly, so that I can delay colors showing on my Simon says game #271

Closed robertzehnder closed 8 years ago

robertzehnder commented 8 years ago

I spent a long time trying to figure this out. Essentially, when you get past round 1 in Simon says, you need to flash the colors in order, so that the player can distinguish the order in which they need to press the buttons.

Once I get past round 1, all the colors flash at the same time. I need a sanity check from someone that I'm going about this the right way and a suggestion on how to debug. Thanks!

var selection;
   for (i=0;i<simonSaid.length;i++) { //Displays pattern for user to match
     selection = '#' + simonSaid[i];
     setTimeout(fader(selection), 2000);
   }
})

function fader (div) {
  $(div).fadeOut(500).fadeIn(500);//css('opacity', '1');
}
andrewsunglaekim commented 8 years ago

I think we hashed this one out in person. Let me know/reopen if you're still having issues with this.

robertzehnder commented 8 years ago

We did thank you