This is a simple Memory Game Web Application based on Halloween theme called "Witchy Pairings", created as part of our Foundations of Software Engineering coursework. The game is designed to test a user's memory and is made up of a deck of cards, each card containing an image assigned randomly. The goal is to click on a card to reveal the image behind it, memorise the card containing that image and match cards with similar images until all the pairs are matched.
The challenge is to match all the cards in as little time as possible, making the fewest selections possible
Click on the level of your choice (Easy, Medium, Hard) to start the game.
Click on the blocks to reveal the image behind it. Do it to the remaining blocks and find the matching pair.
Continue revealing cards and working your memory to remember each unveiled card.
Match cards properly with less moves and in faster time.
You can reset the game using “Reset” button.
Check the time with the help of “Timer” at the top of the game.
You can go to the home page with the help of home button.
The index page is made up of a modal that contains instructions on how to play the game, and a Start Game button taking the user to the game page. The user can also click on the level of their choice and play the game. The Start Game button takes users to the default Easy level of the game. The The game is made up of a single page containing a header, a score panel that keeps tabs of performance indicators such as the time, the number of moves and the current star rating of the user, depending on the performance, and also contains the reset button.
The game board is made up of a deck division containing cards based on the level, which were created dynamically in javascript. Each card consists of a front face and a backface. On card hover, the card background lightens up, and on card click, the card flips 180 degrees and reveals the image behind it, which the user then needs to memorise to improve performance.
A "Win-Game" Modal appears in the center of the screen upon completion of the game, providing feedback concerning grade, star rating and time taken to complete the game.
The deck of cards was designed using CSS grid, in order to ensure responsiveness.
Fonts used were Exo 2 and quicksand as they are very readable and game-friendly, conveying a slight comical feel which is appropriate to the goal of the game.
An array that stores the image paths, which will be assigned to the cards and displayed on their backfaces.
An array that stores opened cards and an array that stores matched cards.
Function that shuffles the images array when the game is loaded
A function that initiates the game which invokes the shuffle function, assigns random image onto each individual card and appends cards to the deck.
A timer function which is called in the card eventListener that updates the innerHTML every 1 second interval from the moment a card is clicked.
A stopTime function that clears the time function interval.
A reset function that resets all global variables and the content of HTML elements (timer, stars, moves, and their innerHTML) and empties all arrays.
A movesCounter function that updates the number of moves made.
A function that updates the star rating depending on the number of moves the player has made to complete the Game.
The number of starts will decrease the more moves a player makes.
A function that compares two cards in the openedCards array when its length is 2, and decides whether they're a match or a noMatch.
If they match, they will be pushed to the matched cards array, otherwise they will be removed from the openedCards array.
A function that fetches the player stats, and provides appropriate feedback based on the stats.
A function that displays the win-game modal.
A Win-game function that displays the win-game modal when game is completed, and calls the stats function and stoptimer function.
A function that handles clicked cards, applies flip animation, plays audio, reveals backface and adds card content to openedCards array.
As a user, I would like to:
As a backup to using Chrome developer tools to check for responsiveness across multiple devices, I have also used http://ami.responsivedesign.is and was very pleased with the outcome, and the game layout across various screen sizes. -->
To publish the website: