Giter VIP home page Giter VIP logo

memory-game's Introduction

Memory Game (AngularJS Demo)

Match each square by color! Click the squares to flip them. Score multipliers are applied if one or both of your matching squares were viewed for the first time. Also check out the 'Peek' button!

Features

Score Multiplier: Each match is worth 1pt minimum. If ONE of the matching squares has not been viewed before, the match is worth 3pts. If BOTH of the matching squares have not been viewed before, the match is worth 5pts. Use logical deduction to score the maximum amount of points!

Peek: We all know this game can be frustrating, so take advantage of the Peek button! After clicking the button, the screen will darken and the cards will glow, giving the user 5 seconds to hover over any card they wish to peek at its color. Once the timer expires, the Peek button can no longer be clicked again. It's up to the user to decide whether they want to scan the board early on, or save it for later to score crucial mulitpliers.

Architecture

This app was built to serve as an AngularJS demo - no jQuery or javascript header code used! The architecture consists of one view, the HTML file, and one controller, app.js. The main view is partitioned into two sections, the sideBar and the container. In the sideBar, we have the game title, the Reset and Peek buttons, and three text labels (current score, high score, and timer). The container holds a 5X4 row of translucent squares, which serve as the "cards" in the memory game.

  • Angular.js
    • Controller
      • One controller is used, containing six different $scope functions. Example functions: toggling a square and determining how many points should be awarded, starting/ending the timer, initalizing/reseting the game, and checking for end game conditions
    • Directives
      • Many ng-directives are utilized in the view, and logic in the expressions help implement functionality that changes the score on the page, displays and changes the score multiplier, sets square color if it's "flipped"
      • Custom directive created to implement the mouseover/mouseout effects when 'Peek' is activated
    • Misc
      • Third party library used for end game dialog box: ngDialog
      • Open source javascript functions used to randomize the color array and create a javascript timer
  • CSS
    • Transitions (linear) used on square "flipping", as well as endgame dimming overlay
    • Effects: Box shadow used on squares, blur effect used on squares when 'Peek' enabled, gradients used on buttons

memory-game's People

Contributors

jml6m avatar

Stargazers

Puranam Pradeep Picasso avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.