Round 1 is great for both simon and player. In round 2 Simon keeps looping.
Can you help guide me in the right direction?
Here’s the pen: https://codepen.io/KoniKodes/full/aVLWZE/
Round 1 is great for both simon and player. In round 2 Simon keeps looping.
Can you help guide me in the right direction?
Here’s the pen: https://codepen.io/KoniKodes/full/aVLWZE/
Are the sounds defined (kiwisnd, for example)? And what does kiwisnd.play()[0];
mean? Is the promise returned by play()
viewed as an array?
The sounds are defined in the html settings below the header meta tags.
I am not sure why the [0] is there, I think I read that was the way to make it work. Apparently not since the first sound doesn’t happen when it should. I’ll remove those and see if it helps.
Thank you.
Thank you for catching that. the playr = []; should be playrseq = []
It was to be used to set the current player is the Player and the Player array is empty.
I have changed that.
Thank you,
The slight delay is because the sequence is randomizing 20 indexes before the Simon Move.
The first iteration should be round 1 at index 0.
The second iteration should be round 2 at index 0 - 1.
Your conclusion is correct. I can not find the way to clear the second setInterval and have the simon Sequence begin at index 0 through to the index of the current round.