Trivia Game Help with Tables
mrchris317
Member Posts: 78
Hey guys I want to make a trivia game. I assume I need to use tables for this. I want to have questions generate randomly from a bank of questions. Then they will have predetermined answer choices.
Example- Which color is not in the rainbow?
a- Blue
b- Green
c- red
d- gold
The player would tap gold and be awarded a point and then next question would play, etc.
The things is, I dont know how to do any of this. So if you can help me out by pointing me in the direction of tables that store the questions and answers, the variables, the changing questions, right vs wrong answer and anything else need to make a trivia game like this, I would really be grateful. Thank you.
Chris
Example- Which color is not in the rainbow?
a- Blue
b- Green
c- red
d- gold
The player would tap gold and be awarded a point and then next question would play, etc.
The things is, I dont know how to do any of this. So if you can help me out by pointing me in the direction of tables that store the questions and answers, the variables, the changing questions, right vs wrong answer and anything else need to make a trivia game like this, I would really be grateful. Thank you.
Chris
Answers
For example, a single row in your table would have this format:
[Question]
[# Answers]
[Correct Answer]
[Answer 1]
[Answer 2]
[Answer...etc]
That should get you started.
A trivia game is not hard to set up in tables, and @PixelMetal has given you some good ideas. But if that's over your head, back up and learn from videos and other resources here on the forums.
If you get stuck, post a screenshot of your rules or some more information about what you tried and we can give you assistance.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
1) If I have 100 questions and each question has 4 answers, do I have to make a table of all questions and a table of all answers or I can put them in 1 table.
2) How do I make the questions appear random, but the app knows not to display that question again within the same game.
Example- Question 2 appears and is answer, I dont want it to show up again in that round.
3) How do I make it so it knows which is the correct answer?
4) How can I trigger a right/wrong response when an answer is correct (similar to question 3).
Im thinking the scene will have 5 actors. 1 that displays the questions from the table. Then 4 actors to display a response each. Each of those actors will have a touch behavior. Is this correct?
Thanks for all your help.
Chris
2) If you Google "gamesalad random without repeat" (without quotes), you'll have your answer. One way to do it is to put all possible question numbers (i.e. table row numbers) in a separate table and then choose a random(1,tableRowCount(TableName)) question row and delete the row that was chosen after you use it. If you loop through that, each time a row is chosen, it will be deleted from the separate table and never used again.
3) Check the table value against the guess that was inputted. You have to create an attribute to temporarily store the guess that was made (e.g. "gold"). You can do this with a text attribute and then compare it to the table cell that holds the answer for that question.
4) Use Rules. When game.currentGuess is tableCellValue(|T| CorrectAnswers,game.questionNumber,1) ... [celebrate, hug someone, display particles, spawn a cute penguin, award the player points, ...]
*I've started naming all of my tables with |T| at the beginning because it makes them easier to find in the expression editor.
Yes, five actors. You're thinking right!
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I am able to display the question randomly (although it repeats), but I am not able to match the correct answers to the correct questions.
I am also not sure how to make the questions right or wrong. I watched the videos you suggested but I am still unsure.
So, I need to know how to randomly display the question (without repeating), with corresponding answers (that also dont repeat).
I need to know how to select the appropriate answer to add to the score, and make sure the wrong answer is selectable but gives a different outcome than the right answer.
I also need to know how to go to the next question.
Im really bad with this stuff. Thank you for all your help and to anyone else who has helped or wants to help in this instance.
Chris
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
The discussion started in January, but I've been building the app for mrchris317 since then and it's close to release. And yes, we did use tables.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
http://marketplace.gamesalad.com/#query=trivia&product=16610