Giter Club home page Giter Club logo

whack-a-piggy's Introduction

Whack a Piggy

Deployment Link


Description


  • The aim of this game is to create a simple but fun interactive adaptation of Whack a Mole.
  • It will have a count down clock with the aim of whacking as many piggies as possible in the time frame, each piggy hit will increase your score by 5 the game ends once the count down timer hits 0.
  • The game also has a start button and when the game ends has the option to restart the game to play again.
  • I feel the game doesnt need a lot of explanation so the start game has one line of instructions with the title of the game and the start button.
  • The main game starts as soon as you click start with the piggy moving randomly and the timer counting down in 1 second increment from 30 until 0.
  • The end game page shows once the count down reaches 0 and shows you your final score and gives the option to restart the game with a button.
  • This project will include HTML, CSS and Javascript with the main focus being on using JavaScript to make the game interactive.
  • Target audience for this game is for people looking for a light and fun game which tests reflexes on how fast you can react to catch a moving object.

Game Screenshots

  • Screenshot 2022-03-10 at 21 02 44
  • Screenshot 2022-03-11 at 10 36 52
  • Screenshot 2022-03-10 at 23 02 10

User Experience


As a site owner

  • I want the game to be easy to use with clear istructions
  • I want the user to enjoy playing the game
  • I want the game to be entertaining
  • I want to be able to upgrade the game as my knowledge increases

As a site user

  • I want a simple fun game
  • I want to understand the game
  • I want the game to be engaging and interesting

Design


Colour scheme

  • The main colours I have picked for the site are #404E5C,(charcole) is used for the text colour.
  • #FF86C8(persian pink) is the main game colour used for the background of the start over lay page, the main game page and the end game over lay page.
  • and #FFFBFE(snow) which is used for the game buttons.
  • I have picked these colours using Coolers and have imported them from this site.
  • These colours work well together and I think they will make the game bright and fun.

Typography

  • The font style I chose is Gloria Hallelujah with a back up of Sans Serif. GH was imported from Google fonts. I choose this style as I felt it kept the game light and fun.

Imagery

  • The images have been taken from adobe stock as I have an account with them.
  • Screenshot 2022-02-27 at 19 03 23

Wire Frame


Screenshot 2022-03-09 at 21 01 22

Screenshot 2022-03-09 at 21 01 59

Screenshot 2022-03-09 at 21 01 35

Features developed


  • A timer which allowes the user 30 seconds before the game ends.
  • A random moving image that the user must try click in time to increment their score.
  • A score counter which allows the user to see their score.
  • A start game button which begins the game once clicked.
  • A restart game button which starts the game again once clicked.

Future Features to be implemented

  • An option for the player to put in a username.
  • A leader board which shows the highest score
  • A personal leader board for the user to see their own personal highest score
  • Levels which make the piggy move faster and with a bigger amount of circle options.
  • Audio when the piggy is correctly clicked .
  • An image and audio when an incorrect circle is clicked.
  • Fix known bug listed below with a cannot click funtion

Tecnoloigies Used


  • HTML5
  • CSS
  • JavaScript

Frameworks, libraries and programs used


Testing


  • The W3C Markup Validator and W3C CSS Validator Services are going to be used to validate every page of the project to ensure there are no syntax errors in the project.
  • Images of the validated HTML and CSS
  • JavaScript was tested using jshint
  • A test was also carried out on lighthouse using chrome dev tools screeshot below

Screenshot 2022-03-10 at 20 38 01

Screenshot 2022-03-10 at 20 42 48

Screenshot 2022-03-10 at 21 21 00

Further Testing


  • TO NOTE this project is not suited for Firefox and Edge, and may not work correctly on breakpoints not listed below.

  • I carried out testing for this project using mainly chrome dev tools to check and see what devices it is responsive on. This project was built for a laptop originally then tablets, mobiles and then larger screens. While writing the js code I used the console.log to continuiously test my JS. I tested the functionality of the game after each function was add in JS to ensure functionality had not changed.

  • Most testing for the resonsive aspect of the game was done using chrome dev tools, a physical iPhone 11, a Samsung s21, Laptop and Ipad.

  • Dev tools was used to test:

  • iPhone 5/5 SE

  • iPhone 6/7/8

  • iPhone 6/7/8 plus

  • iPhone X

  • Ipad

  • Ipad pro

  • Small laptop (1280 x 802)

  • 24 inch screen (1920 x 1080)

  • 1440p screen (2560 x 1440)

Development bugs


  • Issue with getting the count down timer to begin once the start game button has been clicked, this issue has now been resovled I was calling the countDownTimer at the wrong time.
  • Another development bug I ran into was when I clicked the restart button to call the startGame() function again it would add a new event listener each time which was multiplying the score wit each restart. To fix this I added the eventEventListeners to their own function and called it on page load as the rest of the elements manipulate the DOM to hide and show containers.

Known bugs

  • A user can double click a piggy to increment their score if they are quick enough, I am aware this bug exists and have tried resolving it by trying to implement a cannot click function but I have not been able to get this to work correctly and I do not have enough time on hand to rectify this bug.

Mentor Feedback

  • My mentor advised it would look better to change the backgroud of the circles and not to leave them plain so I have implemented this by using an inset shadowbox in the background.
  • Also advised that the responsive aspect could be better which I am aware of, as I was running out of time to get the entire project finished I have tested the responsive aspect on the devices listed in the testing section of this readMe

Acknowledgements


I would like to credit my mentor Narender for his support during the development of my project. This project is for educational purposes only. It was created as a second milestone project for Code Institutes full stack web development course.

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.