Color Matching game

  • Used vanilla javascript only to bulid this game
  1. Set the global variables to the game
  2. Once the window loads completely then start the game using "load" event listener
  3. Added Arrays to store the strings being used by the game (users choice and random game choice of colors)
  4. Added setTimout property to remove classes and add the recursion event once user done their click event
  5. Used toString() method in Array to check the both colors matched btw them and added if/else statement for it
  6. Added the div element to show the results of the game

Rules,

  1. Press start button to start the game
  2. Match the color and press button again to continue game
  3. Match the colors as much can possible
  4. Guessed wrong means restart the game

Visit the game

https://awizp.github.io/Color-match-game/