Giter Club home page Giter Club logo

javascript-portfolio-project-2's Introduction

Countries Of South America

'Countries of South America' will test people's knowledge on countries of South America. In the game there are 12 points to collect, 12 countries in South America, and you will earn these points by getting the answers right. As soon as players start playing the game a quesition that relates to the answer/country will appear, they have to guess which country we are describing or asking them about. If they get the answer right, the player will earn a point and will be able to move on to the next question, the goal is to get as many points as you can. There will be a timer, this adds pressure to the game. If the timer runs out, the question will be answered automatically and users will not be able to select an option.

Am I responsive picture

Features

Home page


  • In this page you have the title of the game in red, this will instantly give the user an idea of what the game is about. The'Play Game' will launch the game, laod the question and set the timer.
  • Below there will be a 'Rules of The Game' button, if you press on this button a box with the rules will appear on the screen, this will contain the rules and explain to users how the game works, how to earn points and how to complete the game, and if they want, the rules will explain that they can also quit or restart the game.
  • Home page appearance on a laptop Home page appearance on a mobile

    Rules of the game on Desktop and Mobile screens

    Image of how the rules box will look on a desktop screen Image of how the rules box will look on a mobile screen


    Within the Game -


  • In this area of the game, it will keep track of what question the user is on, there will be a timer that will make it feel like quiz, this will add more pressure to the game, it is going to be a 15 second timer, when the timer hits 0 the correct answer will be revealed, options will be disabled and user will have to move on to the next question.
  • In this area there is going to be the question AND the options that users will be able to select from, users will have to read the question and guess which country they are being asked about or which country is being described.
  • Users can hover over the question, the cursor will become a pointer on the options they can select, the color of he boxes will also change.
  • Questions and options

  • After users select their answer, the options will be disabled and they can only select home, restart or the next question. Pointer will get disabled.
  • If the user select the correct answer then their option will turn green, next button will appear
  • Users option turns green

  • This is the mobile verison of the game, when answer is correct it turns green, will act the same as on the laptop
  • Questions and options of the game on a mobile screen

  • If users select the wrong answer then their answer will turn red, and the correct answer will appear green, the mobile version will also behave the same
  • User option turns red when wrong and correct answer turns green

    User option turns red when wrong and correct answer turns green

  • If user does not manage to beat the time then options will get disabled and correct answer will turn green, as you will be able to see, the timer is on 0 and the answer has been revealed
  • Correct answer turns green automatically when user cannot answer withing 15 seconds

  • In this part of the game there will be a Home button, a next question button and the Restart button.
  • The home button feature will be there incase the user wants to quit the game or to look at the rules again
  • The 'next' question button will only appear after the user has selected an answer, they won't be able to skip the question, this button will move on to the next question.
  • The restart feature will restart the game from question one, this will not take the user to the home screen

Here will a nav bar with a home button, next button and restart button

  • After question is selected next button will appear
  • Here will a nav bar with a home button, next button and restart button

  • When all question have been answered a results box will appear on top of the questions with how many correct answers you got, and then two buttons at the bottom, one to go to the home page or to restart the game and play the game again
  • Results box with number of correct answers users scored

  • This is how the results will appear on a mobile device
  • Results box with number of correct answers users scored on mobile device

    Wireframes


  • So for my game my initial design was for it to guess the country by the flag, but as I got on with the project it was just difficult to have my idea blossom, I ran into so many obstacles with finding a way to implement the image when the question was called out at random from the array 'questions'.
  • So I went for a basic quiz question game.
  • But, even though it doesnt meet my inital wireframe design my game was still inspired by the wireframe, I still have the hidden Bolivian Flag, my game has a timer, instead of keeping track of the score my game keeps track of the question they are on. Unfortunatly I had to bin the 'hint' button, the sound toggling, and the highscore section.
  • But, I still have a home button, the next question button after user answers, and a restart button
  • User assist bar

    home-restart-next

    Design -


    • Fonts

    • The fonts that will be used for this project are 'Smooch Sans' and 'Fredoka'

      Smooch Sans is going to be used for headings, and for areas where users are going to be looking at majority of the time. Fredoka will be used for the rest of the website, time counter, the results pop up box at the end.

    • Colors

    • The main color for the game used was yellow (#DECC2A), the title will be in a red container and the 'Play Game' Button is in green container. The main page has a hidden flag within it and these are the colors of Bolivia.

      Colors for timer are going to be opposite colors from the main color so that it stand out more, adds accessibility to users so that it does not blend into the background too much.

      Colors for buttons will invert when user hovers over them, this will add interactivity and let users know that it is a button and that it can be pressed.

    Technolgies Used -


    • HTML5 - Provides the content and structure for the website.
    • CSS3 - Provides the styling for the website.
    • JavaScript - Provides the functionality of the website.
    • Google Chrome DevTools- Used to test responsiveness and debug
    • Github - Used to host and deploy the website.
    • ProtoPie - Used to create my wireframe
    • Favicon - Used to create the favicon.

    Testing -

    Browser Compatability

      Testing done on these search engines, website opened as it should and executed all questions and features without issues
    • Chrome
    • Safari
    • Internet Explorer

    Code Validation

    To test my project I used W3C HTML Validator, W3C CSS Validator and JSHint Validator, between the index.html and game.html there were 4 errors found, the CSS had a few mistake as well with e.g. 'border: solid red;' and the validator said I had to write this differently, 'border: solid; border-color: red;' this was solved but apart from that, no errors. With JSHint I got several errors regarding " 'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz)."

  • W3C HTML Validator
  • Image showing that my HTML has no errors

  • W3C CSS Validator
  • Image showing that there are no errors in my css

  • JSHint - For the script I had several warnings but these were because of semi colons on my work, the next set of warnings are asking me to update my version of JS and use ES6.
  • Lighthouse Testing

  • I tested my website using the lighthouse function on Google
  • These are the results I got
  • This image is showing the results of the home page of the game
  • This image is showing the results of the home page of the game

  • This image is showing the results of the lighthouse testing of the questions area on a desktop
  • This final image is showing the lighthouse results for the questions area on a mobile

  • Lighthouse results using Microsoft edge


    Desktop Testing

    Image of lighthouse reults for Microsoft Edge, home page

    Image of lighthouse reults for Microsoft Edge, game page

    Mobile Testing

    Image of lighthouse results for Microsoft Edge, home page on a mobile screen

    Image of lighthouse results for Microsoft Edge, game page on a mobile screen


    Debugging

      Resolved bugs

    • One of the bugs I got was the console error.favicon, after searching what the problem was it was easy to fix, the website now has a favicon and the error has gone away

      Unresolved bugs

    • I have this on my console when I load the index.html, but when I load the game up the console error dissapears and the code is fine....

    Unsolved bug


    Deployment

    Deploying the project

      To the deploy the project we are going to be using GitHub, to be able to launch the website we have to first...
    1. Go to the GitHub repository and go on the project 'JavaScript-Portfolio-Project-2'
    2. You will open this repository and select 'Settings' just above the green 'Gitpod' button
    3. You will scroll down the 'GitHub Pages'
    4. So for the website to be deployed online we have to select the 'Branch' on the 'Main' and set it to 'main', after this your project will turn green when ready to launch and will look like this...

    Screenshot of GitHub pages showing active website link for my game

    Credits


    Content

    • Font taken from Google Fonts
    • Icons used from Font Awesome
    • Favicon.io for generating the favicon I am currently using

    Code

      Code
    • Many inspirtaions from CI students, I took a look at everyones works, their ideas, their code on how they did what they did. It inspried me to make a quiz game and add some features like a timer or a question counter, these different ideas were inspired by looking at peoples work.
    • Searching for different types of ideas on YouTube, StackOverflow gave me different ideas on how to write my code, how to get over obstacles.

    Acknowledgements


    I completed this game based of the Learning Objectives for my 2nd Project which is part of my Full Stack Development Course, I'd like to thank my mentor for the help through the project, giving me ideas, inspiring me to keep going and helping me better my code.

    Future plans


    • I would like to implement a function where users can put there name down and the game will only let them play when that input area has been filled
    • With the name of the user I would like to create a global highscore where every user that played the game can store their codes and other people can see the top codes, this will record the number of correct answers the player got and how quickly they managed to complete the game
    • I would like the questions to be randomised as well, but I had difficulties with this but I feel with more time and research I will find a way around this.

    • This was a struggle for me, when I first started JavaScript I could not follow a code, but now I can follow some code, I wish to write code on the spot instead of searching online for help, but baby steps.

    javascript-portfolio-project-2's People

    Contributors

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