How do I make trivia game ?

Just started using Construct 2? Post your questions here

Post » Tue Jul 28, 2015 11:26 am

How do I make trivia game with so many question in text an the answer of the question is in image, then I can random my question and my answer.
If you know it, please help me. I will gladly sent my project.campx
B
6
S
1
Posts: 39
Reputation: 495

Post » Tue Jul 28, 2015 5:19 pm

So, I have question again if I have an quiz game, example :
Who is the first presiden of Indonesia Republic ?
A. Habibie
B. Soekarno
C. Jokowi
I used a file text as an array for my question. And an image for my answer, please tell me how do I make it ?!
B
6
S
1
Posts: 39
Reputation: 495

Post » Tue Jul 28, 2015 6:09 pm

Follow some tutorials and learn C2 ; this is a very general sort of question and suggests a lack of coding experience. Don't run before you can walk.
My tutorial through development blog is at http://myconstruct2dev.blogspot.co.uk/
B
12
S
3
Posts: 221
Reputation: 1,328

Post » Wed Jul 29, 2015 3:52 am

Dear @paulscottrobson,
well thanks for the suggestion, but right now I have to run you know, cause it's for my project
B
6
S
1
Posts: 39
Reputation: 495

Post » Wed Jul 29, 2015 7:24 am

Yeah, I know. But following a few tutorials or a course will get you there more quickly. People sometimes jump into these things planning to rewrite Super Mario World, get frustrated and give up. It's much better to start with "Pong".

Incidentally, I would check that you can use C2 for your project if this is for a course.
My tutorial through development blog is at http://myconstruct2dev.blogspot.co.uk/
B
12
S
3
Posts: 221
Reputation: 1,328

Post » Wed Jul 29, 2015 7:57 am

@paulscottrobson, I hope you know which one of the step which is better for making a trivia game. I want my question in a text and my answer is in an image(spirite)
B
6
S
1
Posts: 39
Reputation: 495

Post » Wed Jul 29, 2015 4:02 pm

Well, I would look at the Sprite / Load Image from URL stuff
My tutorial through development blog is at http://myconstruct2dev.blogspot.co.uk/
B
12
S
3
Posts: 221
Reputation: 1,328

Post » Fri Jul 31, 2015 5:51 pm

Simplest way I can think to do trivia is build an array. With columns and as many rows as you need. You will need to either manually design the array with each item when the game starts but since this is potently a large array writing a JSON file would be simplest. If you are using windows a simple notepad file saved as UTF-8 and named like "MyTriviaList.json" Then in C2 right click on ProjectFiles and add new and save the .json file there.

The JSON looks much like this
Code: Select all
{"c2array":true,"size":[2,4,1],"data":[
     [["This is the first question"],["A: This is answer A"],["B: This is answer B"],["C: This is answer C"]]
     [["This is the Second question"],["A: This is answer A"],["B: This is answer B"],["C: This is answer C"]]
]}


Then inside C2 use AJAX to load project file then on complete load your array from JSON using Ajax.LastData. Form then its more art and personal choice of design and I can not help you there.

Best of luck

ps "size":[row,column,depth] make sure that is the correct size or it will not work.
"Were all mad here. I'm mad, your mad." "How do you know I'm mad?" Asked Alice. "You must be" Said the Cheshire Cat. "Or you wouldn't have come here"-Lewis Carroll: Adventures In Wonderland
B
7
S
3
Posts: 113
Reputation: 1,295

Post » Sat Aug 01, 2015 7:30 am

@CrazyVulcan, thank for the answer I will try it
B
6
S
1
Posts: 39
Reputation: 495

Post » Sat Aug 01, 2015 2:56 pm

@CrazyVulcan
hey I made this code
"{""c2array"":true,""size"":[4,6,1],""data"":[[[""Click on the Blue""],[""Red#0""],[""Green#1""],[""Blue#2""],[""Yellow#3""],[2]],[[""Click on the number Two""],[""Two#4""],[""One#5""],[""Three#6""],[""Four#7""],[4]],[[""Click on the Star""],[""Circle#8""],[""Triangle#9""],[""Star#10""],[""Square#11""],[8]],[[""Click on the Purple""],[""Circle#12""],[""Triangle#13""],[""Star#14""],[""Square#15""],[13]]]}"

the problem is, that the question number 4 doesn't want to appear. It's just showing 3QA
please help me
B
6
S
1
Posts: 39
Reputation: 495

Next

Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests