Trivia Game

7

Index

Attached Files

The following files have been attached to this tutorial:

.capx

game-of-trivia.capx

Download now 173.64 KB

Stats

10,790 visits, 24,018 views

Tools

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 25 Mar, 2015. Last updated 19 Feb, 2019

As I promised here is my trivia Game

Writing Trivia game is not that hard. Writing any game or software uses logic and that’s what Trivia game is. To create this game you will not need any plug-ins. Construct is very powerful tool. What you will need is free version or latest licence version. If you are using free version and if you can have the funds for then please buy it. C2 is worth weight gold. Easy to use

For our Trivia game we will need text file so we can load it in our project. Your file looks like this below: Please make sure your txt file looks exactly like mine if not your game will not function.

And so on until you have ten names of data. Remember to use semicolon (;) at end of your line. This means line of data finish there. You can use any other symbol. At end of first Data use pipe line to end that part. To get pipe line press shift and forward slash (\). You should get | pipe.

Before we go further lets create project and load text file. Check how we will implement our array.

Create new project and call trivia game. Trivia game Project.

Open Construct 2 and create new project give name Trivia.

Set windows size default

Set layers size to default

On layers we will have 5 Textboxes so your layer will look like below

• Name top textbox Question

• Answer random question holder

• Answer1 random question holder

• Answer2 random question holder

• Answer3 random question holder

• Answer4 this one will be our correct answer holder

• Feedback this one will give you Feedback Correct or Incorrect andswer

• Add Function

• Add arrays

• Touch

Please open your Even Editor and First create global variables

enter this line

  • 9 Comments

  • Order by
Want to leave a comment? Login or Register an account!
  • Hi - I'm very thankful for this solid tutorial!

    Is there a way to link the correct answers to different type of scores?

    like what they do on personality quizzes?

  • Hi, i followed your tutorial and excellent explanation.

    My question is what if I wanted to add categories in this?

    I tried by duplicating the layout and event sheet, renamed it and also imported the new question files for each category. but after running the game same questions show in each layout.

    It will be great help as i have to submit the project for my college.

    Thank you

    Regards

    Kamal

  • Thanks excellent contribution friend but

    if i want to add more questions? what to do you help me to add more questions

    Thank you

    • hey fernando, i guess lordshiva isn't rsponding since last 4 years. anyway we can help each other though.

      for your query

      1. edit the questions text file. add more questions of your choice.

      2. reimport text file.

      3 edit function "Get random question" setrandom question from 9 to your questions number.

      4. change the number of question in system also from 0 to your number of questions.

      this works for me. hope it will do for you.

      and if you happen to find how to add categories, do share i am stuck at this.

  • thank you

  • can this be done in construct 3

  • Load more comments (1 replies)