Built by: Bryant Gilgan
Click the following link to be redirected to the live version of the code!
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...
Click the following link to be redirected to the Wireframe and Design Inspiration for this project! Lucid
Memory Kombat is ready to begin. Press start to begin the round.
Once you press start the cards are loaded onto the page to begin matching.
When two cards have been clicked they will flip back over after .3 seconds. How good is your memory?
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.
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?
// 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.
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.