Skip to content

madhur-taneja/Memory-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Memory Game

A single page web app consisting of 16 cards arranged randomly in a grid. The deck is made up of 8 pairs of cards, each with different players on one side. Match the same players by flipping the cards in minimum amount of moves and time for a higher score and rating.

Open and view the Project using the .zip file provided or at my Github Repository.

The Game is also hosted on Github.

Table of Contents

Getting Started

This Project is all about demonstrating my mastery of HTML, CSS, and JavaScript. I built a complete browser-based card matching game (also known as Concentration).

This project was built from scratch and is a part of Udacity's Front-End Web Developer Nanodegree program. The project will be evaluated by a Udacity code reviewer according to the project rubric

Udacity also provides the starter code for this project which can be found here

Instructions

The game board consists of 16 cards arranged randomly in a grid. The deck is made up of 8 pairs of cards, each with different players on one side. The cards are arranged randomly on the grid with the players side down.

Match the same players by flipping the cards in minimum amount of moves and time for a higher score and rating.

Each turn:

  • The User flips one card over to reveal its underlying player.
  • The User then turns over a second card, trying to find the corresponding card with the same player.
  • If the cards match, both cards stay flipped over
  • If the cards do not match, both cards are returned to their initial hidden state

The game ends once all cards have been correctly matched.

Tools Required

Development

  • Create index.html with following markup:

    • Start and Win Modals
    • Game board with basic grid structure
    • Icons to handle functionalities
  • Create styles.css with additional styling and media queries to make the app more responsive

  • Create engine.js for adding the functionalities:

    • Add a Model called players with all the player info
    • Add a viewmodel with the following functions:
      • A function to trigger the game to start when clicking on Start Modal
      • startGame which Shows and Hides the Modal and calls runGame
      • runGame which runs the game and contains the following functions:

        createCards
        shuffleArray
        flipCard
        matchCards
        setRating
        timer

      • resetGame to restart the game by resetting the game board
      • endGame to end the game and display the results in a modal

For details now how these functionalities have been implemented, refer the source code.

Running the App

  • Open the project through the .zip file provided and extract file.

    Open index.html from the root directory in the browser of your choice.

  • Click on start icon to play the game and get ratings(score and stars) for your performance.
  • Restart the game with the reset button at the bottom of the screen or in the results modal after completing the game

Screenshots

Start Screen

Start Screen

Game Board

Game Board

Gameplay

1. Unmatched Cards Open

GamePlay

2. Unmatched Cards Closed

GamePlay

3. Matched Cards Open

GamePlay

4. Winning Screen

Win Screen

References

About

An arcade game in the form of a web app which tests your memory skills

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published