Skip to content

gryantbilgan/Memory-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

52 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Screenshot 2023-09-28 at 10 52 48 AM

Test Your Mind

Built by: Bryant Gilgan

Maintenance

JS badge HTML badge CSS badge GitHub Visual Studio Code

Click the following link to be redirected to the live version of the code!

Description:

MEMORY KOMBAT is a fully functional web game that utilizes Javascript, HTML, and CSS to test how good your memory is. GET OVER HERE! The battle for the Cerebral Realm has begun. Players will have to use their cognitive and recall abilities to match the unique set of cards displayed before them. Delve into the pit and test your mind. I have nothing further to teach you. You possess the knowledge. All that is lacking now is the will...

πŸ”— Associated Links:

Click the following link to be redirected to the Wireframe and Design Inspiration for this project! Lucid

πŸ‘Š Main Menu

Screenshot 2023-09-28 at 12 32 37 PM

Memory Kombat is ready to begin. Press start to begin the round.

The Match is Ready to Begin

Screenshot 2023-09-28 at 1 43 45 PM

Once you press start the cards are loaded onto the page to begin matching.

Begin Matching

Screenshot 2023-09-28 at 1 49 29 PM

When two cards have been clicked they will flip back over after .3 seconds. How good is your memory?

Matches Made

Screenshot 2023-09-28 at 1 53 30 PM

If two cards have been matched they will remain displayed, so you know how many cards you have left. Your score will increase the more matches you get, but if you guess incorrectly your number of guesses will decrease.

End of Game

Screenshot 2023-09-28 at 1 55 33 PM

As soon as all of the matches have been made, the cards will disappear and you will be declared Victorious or Defeated. Do you dare to try again?

πŸ’» Technologies Used:

  • JS badge
  • HTML badge
  • CSS badge
  • GitHub
  • Visual Studio Code

πŸͺ€ The Code Behind the Shuffle

// shuffle card function
function shuffleCards() {
  shuffledCards = [...CARD_ARRAY];
  shuffledCards.sort(() => .5 - Math.random());
}

The code block above was not the most important function in my program, but it was valuable. There are other ways to shuffle items from an array, and I decided to use this one because it seemed most simple for me at the time. I was able to assign my array of a set of cards to a variable that had no value yet by using the rest operator as my type of reference. Then I was able to sort through this array and shuffle the cards with Math.random(). Because Math.random returns a value that is greater than or equal to zero and less than one. When I subtracted that random value by .5 I am able to get a positive or negative value which the sort method would arrange the cards in a different way each time based off of their value.

πŸ“ˆ Plans for the future:

This memory game was challenging but a lof of fun to build. My mind was definitely tested throughout. Here are some things that I would like to add as I work further on the game:

  • Add audio for that is unique to each of the characters when they have been matched.
  • Add audio to the main menu, when the game is loaded, and when the game has been ended(victory or defeat).
  • Replace guess counter with an animated lifebar that will decrease when incorrect guesses happen and hit sound effects.
  • Replace score counter with a combos counter and hit sound effects.
  • Add more characters.
  • Increase number of cards flipped and needed to be matched.
  • Add more levels that will increase diffculty pertaining to more cards needing to be matched.
  • Increase over all user interaction and user experience by making the game more dynamic.

About

First project for general assembly- Memory Game

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published