Triviology is a trivia game which has fun & curious facts. No particular theme was chosen for the questions but some resounding themes are soccer and space. Players are presented with a trivia question on a card and multiple choice answers. After an answer is selected, the player is informed of whether their selection is right or wrong and given the option to move on to the next question or quit.
Clone(git clone
) this repo to your local machine. Navigate(cd <subdirectory name>
) into the newly created directory.
All of the questions/answers data is stored in the db.json
file. To use this file, if you don't already have a JSON server, in your terminal run npm install -g json-server
. Then run json-server --watch db.json
.
Open another window in your terminal and navigate into the directory where the game files live, aka the newly crated directory after this repository was cloned. Run lite-server
, the game should open in your browser.
-
Flipping card animation revealing results of selection (Gif here)
-
Keep tracks of points and updates with every question answered (Gif here)
Randomizes answers so they're not in the same position when the same question loads:
function shuffleArray(arr) {
let remainingIndices = arr.length;
while (0 !== remainingIndices) {
let randIndex = Math.floor(Math.random() * remainingIndices);
remainingIndices -= 1;
let tempArr = arr[remainingIndices];
arr[remainingIndices] = arr[randIndex];
arr[randIndex] = tempArr;
}
return arr;
}
- skipping undesired questions
- add different question formats (ex: true/false, type answer in input box, etc.)
- Difficulty Level - awarding different quantity of points based on the difficulty of the question
- like, dislike and review questions