Giter Club home page Giter Club logo

whack-a-marmot's Introduction

Whack-A-Marmot

Screenshot of the site on the Am I Responsive site

View the live project here.

The application was a great exercise in organising my files and keeping different concerns separate. The use of modules, allowed me to set variables and strings in the constructor.

The reasoning behind this was to prevent string errors, and keep code DRY.

GitHub forks W3C Validation

Table of contents


User Experience (UX)

The site was designed and developed mobile first.

Marmots in the spring up in the Swiss Alps were the inspiration for this game. The idea was to provide a colourful, visually appealing and stimulating game The colours were chosen to represent spring.

Intended Audience

  • Adults

  • Children

  • User stories

  • Client Goals

    • Provide an online that test and improve:
      • motor skills
      • accuracy
      • concentration
      • hand and eye coordination
  • First Time Visitor Goals

    • Choose the settings
      • dark or light mode
      • easy or hard play mode
    • Read the game instructions
    • Play the game
    • Beat your previous score
  • Return Visitor Goals

    • Improve scores
  • Frequent Visitor Goals

    • Compete with other players

Design

Wireframes

Wireframes were created for the site with Figma.

Figma Wireframe for mobile and desktop

Wireframe for mobile and desktop

Game page for mobile and desktop

Figma Wireframe of start page for mobile and desktop

Start page - mobile and desktop


Instructions modal for mobile and desktop

Figma Wireframe of instructions modal for mobile and desktop

Instructions modal - mobile and desktop


Settings modal for mobile and desktop

Figma Wireframe of settings modal for mobile and desktop

Settings modal - mobile and desktop


To see the full wireframe, view it here.

An additional note regarding the original images for the wireframe.

The initial plan was to use SVG hills. The SVG paths were calculated, a percentage of the length was taken to get the x and y coordinates. Calculation of slope was considered for each marmot angle. This was not feasible at this time, due to SVG paths not resizing to viewport.

This is to be added as a future implementation.


The website consists of the following:

  • Start page
  • Play page
  • A 404 page
  • Instructions modal
  • Settings modal
  • Scoreboard

Colour Scheme

The colour scheme was created using Adobe Color, creating a theme from an image. The colours should emphasise the outdoors and the freshness of spring, which is when the marmots in Switzerland come out of hibernation.

Created colour palette using:

Colour palette for the website

Accessibility Concerns

The colour palette was altered to improve accessibility and increase contrast.

Accessibility tested using the Adobe's Accessibility Tools.

Results and contrast improvements suggestions:

Dark purple & Pale blue

Adobe Accessibility Tools - Color contrast between dark purple and pale blue

Settings modal - mobile and desktop


Feedback from lighthouse testing raised an issue with accessibility and colour contrast. As a result, the red colour was changed on the button with white font.

Typography

Bangers and Oswald Fonts were chosen from Google Fonts. Fonts were selected to represent fun, playful, clear and easy to read.

Bangers 400

Oswald 200

Oswald 400

Oswald 600


References for typography:

When thinking about typography, the type had to suit responsively as well. The fonts had to be also readable on mobile View.

Using Utopia, clamps for fonts and spaces were created. This minimised errors, stopping the fonts from getting bigger at a certain view width and height, or too small, dependent on device view ports.

Imagery

Images are located on all pages. At the top of the page, under the navigation, is the header image. All pages have the same thematic layout, and the layout should be consistent on all pages, including the home page.

All images used were downloaded from:

Images match the theme of spring and outdoorsy.

To increase the speed of the website., all images were compressed. Also, I added the lazy-loading attribute to images showing below the fold.

References for images


Icons were used for social links and buttons. The icons used on the site were taken from:

Features

Details of each feature are listed under General Features on Each Page.

The website consists of the following features:

  • Game page
  • Play page
  • A 404 page
  • Instructions modal
  • Settings modal

Start page

The start page consists of the following sections.

  • Title
  • Three buttons
    • Play
    • Instructions
    • Settings

Play page

The play page consists of the following:

  • Image banner at the top of the page
  • Multiple images, title and text, alternatively reversing the order

Modals for Instructions & Settings

The instructions modal differs slightly from the settings modal, as it contains:

  • A carousel
    • Slider for each page of the instructions

Features of the game

Game

Screenshot of the game play view

Screenshot of the game view for mobile


Screenshot of the game play view

Screenshot of the game view for desktop


The game size and the number of marmot holes are dependent on the device size. The game is not suitable to be played on a mobile device in landscape.

Instructions Modal

Screenshot of the modal for instructions for mobile

Screenshot of the instructions modal for mobile


Screenshot of the  modal for instructions  for desktop

Screenshot of the instructions modal for desktop


The idea was to make the instructions modal not too wordy. I wanted to emphasise the fun of the game, keeping everything simple.

Settings Modal

Screenshot of the modal for settings for mobile

Screenshot of the settings modal for mobile


Screenshot of the  modal for settings  for desktop

Screenshot of the settings modal for desktop


To continue with the theme of fun and simple, the settings also had to echo this.

Scoreboard

Screenshot of the scoreboard for mobile

Screenshot of the scoreboard for mobile


Screenshot of the  scoreboard  for desktop

Screenshot of the scoreboard for desktop


The list could be longer, but wanted the keep only 5 results on the board, as this would ensure that the user would not need to scroll. A note has been added to the Future Implementation, as if the list were to remain short, it should show the top five scores.

Future Implementations

  1. Add random username generator
  2. Change the scoreboard to a leaderboard
  3. Vary speeds with more settings variables
  4. Implement more animation
  5. Be more precise, differentiate between double click and first clicks
  6. Use SVG hills for marmots to pop up from behind
  7. Add missed hits

Accessibility

  • Use of semantic HTML
  • Use of ARIA
  • Use of alt attributes
  • Use Adobe Color to check colour contrast

Technologies Used

Languages Used

  • HTML5
  • CSS3
  • JavaScript

Frameworks, Libraries and Programs Used

Remote and Local Deployment

Git was used for version control. Version control was done locally and remotely. For remote version control, GitHub was used. Regular commits were made after each file change.

Remote deployment

GitHub Pages was used to deploy the site remotely.

github-pages_deployment.mov

Screencast of deployment


  1. Go to the repository

  2. Click the Settings tab

  3. Click on Pages in the left-hand menu, under code and automation Click Pages Screenshot of how to get the Pages section

  4. Under Build and deployment > Source, ensure Deploy from a branch is selected Choose Source Screenshot of source option

  5. Under Build and deployment > Branch, select the main branch Choose Branch Screenshot of branch option

  6. Click save

  7. It may take more than a few minutes, but when the page has been created, you will see the following success message Successful deployed Screenshot of success message

Local Deployment

To contribute or check the code yourself, you can:

  • fork the repository
  • clone the repository

How to Fork

  1. To fork, go the repository
  2. Click on the Fork button in the top left corner of the page. Click Fork
  3. Fill in the form with either keep the name or create a new name for the repository Create Fork

How to Clone

  1. To clone on the repository
  2. Click on the Code button above the repository files.
  3. A drop-down will appear and choose either Click Code:
    • HTTP
    • SSH
    • GitHub CLI
  4. Go to your terminal and decide where you want to clone the files.
  5. Use the copy/paste button and copy it into your terminal
  6. You also have the option to download a ZIP file of the code

Testing

The devices selected were:

  • Ubuntu
    • Firefox 108 on Ubuntu 22.04.1 LTS
    • Chromium Version 109.0.5414.119 on Ubuntu 22.04.1 LTS
  • Mac
    • Safari 16 on macOS Ventura
    • Chrome on macOS Ventura
  • Android
    • Chrome Mi Max 3
    • Chrome Xiaomi Mi 9SE

User experience

Testing implemented from User stories

Client Goals Testing

Client goal Implementation Tested Successful
Provide an online that test and improve: motor skills, accuracy, concentration, hand and eye coordination Yes Yes

First-Time Visitor Goals

First Time Visitor Goals Implementation Tested Successful
Choose the settings Settings available for to choose between dark and light, easy and difficult Yes Yes
Read the game instructions Instructions provided in a modal. Yes Yes
Play the game Start game play, by clicking button. Also users can exit with the exit button on the top right Yes Yes
Beat previous score Check scoreboard to beat score. Yes Yes

Return Visitor Goals

Return Visitor Goals Implementation Tested Successful
Improve scores Return to game to see the scoreboard again (stored in localStorage) Yes Yes

Frequent Visitor Goals

Frequent Visitor Goals Implementation Tested Successful
Other players can add a username Compare scores in scoreboard Yes Yes

Bugs and fixes

Bug / Errors Where / Location site Browser Device Remarks Mode (light / dark) Fixed Solution
Left clicking on first instruction page Instructions Firefox PC When clicking left arrow once on first page, user has to right click twice to get to second page. clicking left arrow twice, clicking right arrow three times to get to second page etc. No Specific device or browser issue. Not able to replicate.
Hitting the marmot Play Firefox PC When holding left mouse button down upon whacking marmot, user drags marmot image away Yes Set "draggable" attribute
Top left marmot Play Firefox PC Body of top left marmot looks cut off. Only head is visible No Not a big issue, so not taken as a priority
Refreshing page Play Firefox PC When refreshing page, game cannot be reset. Previous player name is saved and game cannot be restarted Yes Remove function of setting marmot holes on resize.
Dark Mode Settings Firefox PC Changing to dark mode does not work Yes Fix settings error
Difficulty Settings Firefox PC Changing difficulty does not work Yes Fix settings error
See the marmot Instructions Chrome Xiaomi 9 SE The line "See the marmot" is cut off / not visible Yes Make written instructions hidden in mobile
Whack the marmot Instructions Chrome Xiaomi 9 SE "Marmot" is cut off Yes Make written instructions hidden in mobile
How many marmots can you whack Instructions Chrome Xiaomi 9 SE "Marmots can you whack" is cut off Yes Make written instructions hidden in mobile
Dark Mode Settings Chrome Xiaomi 9 SE Changing to dark mode does not work Yes Fix settings error
Difficulty Settings Chrome Xiaomi 9 SE Changing difficulty does not work Yes Fix settings error
Buttons Settings Chrome Xiaomi 9 SE Black buttons move too far to the right when clicking them Yes Change container size on modal
Marmots overlay Home Chrome Xiaomi 9 SE In some cases the 6 marmots are displayed all over the menu screen. no clue why or how Yes Remove function to redraw marmot holes on resize.
Game start Play Chrome Xiaomi 9 SE Upon game start user has to scroll down a bit. Basically as long as the top line with the URL is high Yes Add overflow hidden
Top left marmot Play Chrome Xiaomi 9 SE Same as above. no neck, no body No Not a big issue, so not taken as a priority
Multiple hits Play Chrome Xiaomi 9 SE It is possible to repeatedly hit the active marmot more than once. Kill count stacks Yes Add removeEventListener after score is increased
Marmot hits Play Chrome Xiaomi 9 SE In some cases the animation upon hit does not show. Kill count still counts No The bug seems related to custom cursor as not recognising click event.
Marmot stays up Play Chrome Xiaomi 9 SE In some cases the marmot that has been hit stays up / comes back up. If this occurs all subsequent hits do not show the animation No To be solved at a later date, not a priority
Marmot goes down fast Play Chrome Xiaomi 9 SE In some cases when user misses marmot it disappears quicker than usual No To be solved at a later date, not a priority
Waking the marmots Load Screen Firefox PC Load Screen message shows only super briefly No Set timeout for this to increase loading page time.

Not solved

All unsolved bugs are fixes are noted as issues on the repository. Issues are to be found here.

Lighthouse

Game

Game page in light mode

Game page in dark mode

Validator Testing

Credits

Code Used

All code is also referenced as a comment in stylesheets.

References & Resources

A list of references used for the site:

Content

The content was short and to the point, and was created by myself.

Media

Wireframe
Game
404 Page

Acknowledgements

This part of the journey was a tough but immensely rewarding one, and I would like to give a big thanks to my partner, Stefan Tschudi for rallying me, keeping me going with endless cups of tea. Acknowledgements also go to those who took the time to provide great insights and advice

  • Rahul Lakhanpal - for keeping me focussed.
  • Class Slack Channel, with special thanks to Ger Tobin.

whack-a-marmot's People

Contributors

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