Git Product home page Git Product logo

ci_pp2_2048's Introduction

2048

(Developer: Zack Owen)

Mockup Image

Live webpage

Table Of Content

  1. Project Goals
    1. User Goals
    2. Site Owner Goals
  2. User Experience
    1. Target Audience
    2. User Requirements and Expectations
    3. User Stories
  3. Design
    1. Design Choices
    2. Colour
    3. Fonts
    4. Structure
    5. Wireframes
  4. Technologies Used
    1. Languages
    2. Frameworks & Tools
  5. Features
  6. Testing
    1. HTML Validation
    2. CSS Validation
    3. Accessibility
    4. Performance
    5. Device Testing
    6. Browser Compatibility
    7. Testing User Stories
  7. Bugs
  8. Deployment
  9. Credits
  10. Acknowledgements

Project Goals

User Goals

  • Be able to understand the rules of the game and how to play
  • Understand when the game has been won or lost
  • Be able to restart the game easily without refreshing the website

Site Owner Goals

  • Deliver rules and information of the game
  • Provide an easy but fun game
  • Let users email to inform about potential bugs or improvements to the game

User Experience

Target Audience

  • All ages of people
  • Anyone who is looking for fun new game to play on the go or at home

User Requirements and Expectations

  • Allow users to indentify rules easily
  • Quick easy way for users to contact the game owner
  • Accessibility
  • All provided information is easily readable on all screen sizes

User Stories

First-time User

  1. As a first-time user, I want to have an easy way of accessing the rules.
  2. As a first-time user, I want to be able to restart the game without refreshing the website.
  3. As a first-time user, I want to know if I have won or lost the game.

Returning User

  1. As a returning user, I want to easily contact the game owner in case of any issues.
  2. As a returning user, I want to find social media links to the site owners previous work.
  3. As a returning user, I want to know my current score.

Site Owner

  1. As the site owner, I want users to contact about issues and bugs.
  2. As the site owner, I want users to find all relative information easily.
  3. As the site owner, I want users to find their way back to the game from the error 404 page.

Design

Design Choices

The webiste has been designed with accessibility in mind. Users with poor vision and for those who are colour blinded can still view and play the game without struggling to see the numbers on screen.

Colour

The colours picked with accessibility for poor sighted users in mind, all colours picked are light with the text being mostly black so it stands out for all users. Colour Scheme

Fonts

Lato with sans serif as a fallback was used for headers and paragraphs on the page as the font complimented the colours well.

Structure

The page is structured in a user friendly, easy to learn way so users who arrive on the site know exactly how to play the game and what buttons to press on both mobile and desktop. The website contains only 2 pages:

  • The main page in which the users play the game.
  • Contact Us page with an email API.

Wireframes

The project templates and wireframes for The Feathered Duck Inn restaurant were designed using Balsamiq.

2048
Contact

Technologies Used

Languages

  • HTML
  • CSS
  • JavaScript

Frameworks & Tools

Features

The webpage consists of 2 pages and 7 features

Title & Score

  • The title and score can be seen at the top of the page
  • The score is updated when a new tile is connected or entered the game board
  • User stories covered: 6

Title and Score

Gameboard

  • Displays in the middle of the screen
  • Shows current numbers in play
  • User stories covered: 8

Gameboard

Rules

  • Rules are shown with the i button displayed above the gameboard
  • Shown under the scoreboard
  • User stories covered: 1

Rules

Footer

  • Shown at the bottom of every page
  • Includes links to social media pages and email api
  • User stories covered: 4, 5, 8

Footer

Email enquiries

  • Displayed at the bottom of the screen in the footer
  • Sends user to a form screen, allows user to send enquiries about the game
  • User stories covered: 4, 7, 8

Email

Result

  • Result displays when the game decides if the user wins or loses
  • Result shows above the gameboard after the game has been decided
  • User stories covered: 3

Result

Restart

  • Restart icon allows users to restart the game easily without refreshing the page
  • Icon is displayed next to the rules icon below the score
  • User stories covered: 6

Restart

Validation

The W3C Markup Validation Service was used to validate the HTML of the website. All pages pass with no errors and only 1 error.

2048
Contact

CSS Validation

The W3C Jigsaw CSS Validation Service was used to validate the CSS style of the website. When validating just my own custom CSS it passes with no errors and no warnings.

style.css

JavaScript Validation

The JShint Validation Service was used to validate the JavaScript of the website. When validating it passes with no errors but 64 warnings which ES6/Mozilla JS extension warnings.

game.js
contact.js

Accessibility

The WAVE WebAIM web accessibility evaluation tool was used to ensure the website met high accessibility standards. All pages pass with 0 errors.

2048
Contact
Error 404

Performance

Google lighthouse in Google Chrome Developer Tools was used to test the performance of the website.

2048
Contact
Error 404
### Performing tests on various devices The website was tested on the following devices - Lenovo ThinkPad Pro Laptop - Google Pixel 6 Pro - Oppo Find X5 Pro - Samsung Tablet

In addition, the website was tested using the Google Chrome Developer Device Toggling option for all available device options.

Brower compatibility

The website was tested on the following browsers.

  • Google Chrome
  • Duck Duck Go
  • Microsoft Edge

Testing user stories

  1. As a first-time user, I want to have an easy way of accessing the rules.
Feature Action Expected Result Actual Result
Information icon Navigate to the i icon Opens up the rules for the game Works as expected
Screenshot
  1. As a first-time user, I want to be able to restart the game without refreshing the website.
Feature Action Expected Result Actual Result
Restart icon Navigate to the refresh icon Restarts the game and score Works as expected
Screenshot
  1. As a first-time user, I want to know if I have won or lost the game.
Feature Action Expected Result Actual Result
Game result Play the game until win or loss Depending on the game result, result shows outcome above the gameboard Works as expected
Screenshot
  1. As a returning user, I want to easily contact the game owner in case of any issues.
Feature Action Expected Result Actual Result
Email Locate the footer, click on the email icon Takes user to the email form screen Works as expected
Screenshot
  1. As a returning user, I want to find social media links to the site owners previous work.
Feature Action Expected Result Actual Result
Social Media Links Locate the footer, click on the social media icons Takes users to the site owners social media accounts Works as expected
Screenshot
  1. As a returning user, I want to know my current score.
Feature Action Expected Result Actual Result
Score Score is shown at the top of the screen Shows users their current score Works as expected
Screenshot
  1. As the site owner, I want users to contact about issues and bugs.
Feature Action Expected Result Actual Result
Email Locate the footer, click on the email icon Takes user to the email form screen Works as expected
Screenshot
  1. As the site owner, I want users to find all relative information easily.
Feature Action Expected Result Actual Result
Relative Information All relative information is easily visible on the screen Users can find all information easily Works as expected
Screenshot
  1. As the site owner, I want users to find their way back to the game from the error 404 page.
Feature Action Expected Result Actual Result
Error 404 Click on the go back button to navigate back to the game Users return back to the main game Works as expected
Screenshot

Bugs

Bug Fix
The game result tells users they have lost despite possible moves still being available Add return validMove function
Users could swipe in a diagonal direction and it the game would play a move Add directional if statements for the game to check if user has moved diagonally and if so to not return a move
Users could continue the game even after 2048 tile showed Add a checkForWin function and applied to combineRow/Column section
Score wouldn't display correctly when combining tiles Added a scoreDisplay.innerHTML = score function and added to get elementbyId(score)

Deployment

The website was deployed using GitHub Pages by following these steps:

  1. In the GitHub repository navigate to the Settings tab
  2. On the left hand menu select Pages
  3. For the source select Branch: master
  4. After the webpage refreshes automaticaly you will see a ribbon on the top saying: "Your site is live at https://deadenigma13.github.io/CI_PP2_2048/"

You can for fork the repository by following these steps:

  1. Go to the GitHub repository
  2. Click on Fork button in upper right hand corner

You can clone the repository by following these steps:

  1. Go to the GitHub repository
  2. Locate the Code button above the list of files and click it
  3. Select if you prefere to clone using HTTPS, SSH, or Github CLI and click the copy button to copy the URL to your clipboard
  4. Open Git Bash
  5. Change the current working directory to the one where you want the cloned directory
  6. Type git clone and paste the URL from the clipboard ($ git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY)
  7. Press Enter to create your local clone.

Credits

Images not referenced below are owned by the developer.

Media

Thanks to Vector Stock for the error 404 image.

Code

In order of appearance:

  • 404 page was build using description on GitHub Docs
  • Credit to StackOverflow for the information on how to make left right swipe gestures on mobile devices.

Acknowledgements

I would like to take this opportunity to thank:

  • My mentor Mo Shami for his wonderful feedback, advice, guidance and support.
  • My partner Chloe for her support, free time away from the child and understanding.
  • Big shout out to Warwick Hart (@Wozza_5P) over in the Slack Community for the help and of course everyone else over in the Code Instiute slack community for their help, advice and support and providing peer reviews on my PP2 and peer code review.

ci_pp2_2048's People

Contributors

deadenigma13 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.