Simon Game - Any Feedback appreciated

Simon Game - Any Feedback appreciated
0.0 0

#1

Here’s my Simon Game

  • Built with HTML, CSS and Vanilla JS

  • To make it easier to test I’ve set it to 12 rounds to win… :wink:

Thank you for any feedback!


#2

Simon is not my fav game but i changed your const wins = 12; to 4 just to see how the game is ending, ofc with me as a winner :slight_smile: . Good job. It seems well coded html/css/js. I would only change start btn color from light grey to something that calls more for action. Light gray is too neutral. :+1:


#3

Congratulations for winning! :grin:

Thank you very much for your valuable feedback! Valid point with the button color, adjusted it to green accordingly.


#4

Hi,

The audio needs to be fixed. At least in my phone, it loads with a lag. You are loading external mp3s each time if I’m not mistaken, right?


#5

Hey @SpaniardDev,

Thanks a lot for your feedback. You’re right, I did load the sounds each time. I have changed it now to preloading the files (according to this article) but it seems I didn’t do it fully correct resp. not playing them the right way so far. I.e. only the first one is played with sound, but starting with round 2 there is no sound anymore on mobile devices. Will try further… if you have a hint resp. solution to this, I would be glad getting to know it :wink:


#6

I forked your pen and made a few changes so I could try it on my phone easily. It works; in my phone at least.

I did a preload of the audio files and stored them in an array so

// Below line 8 on your code:
let audioArr = new Array(4);
for (var i in audioFiles) {
  audioArr[i] = new Audio();
  audioArr[i].src = audioFiles[i];
  audioArr[i].load();
}

// I removed line 125 and changed line 126 to:
audioArr[Number(id[3])].play();
// The same on playSong function (146/147):
audioArr[arr[id]].play();
// Then I removed the code from 49 to 78 as it is useless now.

By the way… On lines 125/126 and 146/147 you have been creating a new Audio instance, therefore overriding the preloading you tried to accomplish.

I didn’t touch the function for the winning song so you have to changed that also.

Definitely not an elegant solution but I wanted to let you notice what I think the problem was.


#7

Thank you very much for taking the time to look into it and outline a solution, greatly appreciated!

It seems to work now. The only thing I had to add additionally was some muted playing of all tabs when hitting the start button, so it fully works on my iphone. As I don’t have an Android device, can’t tell about that one…
Nevertheless, thanks again for the great help!