GithubHelp home page GithubHelp logo

rraj13 / nba-trivia-game Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 7.3 MB

Basketball Inspired Trivia Game!

Home Page: https://rraj13.github.io/NBA-Trivia-Game/

CSS 15.06% JavaScript 75.71% HTML 9.23%

nba-trivia-game's Introduction

NBA-Trivia-Game

Live Link: https://rraj13.github.io/NBA-Trivia-Game/

alt text

Introduction

Hey there! Here I have created an NBA inspired trivia game. The user presses start to begin and is then presented with a question with four possible answer choices. They have 20 seconds to guess before the answer is revealed.

If they click the correct answer, a corresponding "correct" message is displayed along with a GIF, and the same is true for an incorrect answer, except with a corresponding "incorrect" answer. If they do not provide an answer, the page displays an "unanswered" message along with the same GIF as before. The program then waits 5 seconds before displaying the next question. After all questions have been asked, the user is shown a results page where they can find out how many they got right, missed or didn't answer. From here the user can click to play again.

Technologies

HTML 5
CSS 3
JavaScript - objects, constructors, if-else statment, for-loops
JQuery - event handlers, DOM manipulation

General Methodology

The logic for this project involved having a questionCounter variable that incremented each time a question was asked and then answered. The game was made in an array with each of the questions and their data as elements of that array (the questions were constructed as objects and each object was an element in array). The aforementioned questionCounter would start at index 0, display all the information for that question, then once answered, it would increase to 1, 2, 3 etc. In this way, each time the user would answer, the program would display the data for the next question. In addition, I utilized timers to allow the user 20 seconds to answer each question and then 5 seconds between each question display.

This was a great completely front end or client side project. It really required a lot of pseudocoding and logic determination before even writing a single line of code!

Please reach out with any questions!

nba-trivia-game's People

Contributors

rraj13 avatar rahulrajdev avatar

Stargazers

 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.