Problem with quiz game and time count down

Talk about making games.

Problem with quiz game and time count down

Postby NutchanonDotCom » Wed Sep 07, 2011 6:15 pm

My problem is when run the game, The question also change along time count down which I think it does make sense for me because nothing concern between two variable.
I initial the value of question by random it in "next_question" icon and the value of time count down in text actor named "time". My code is so simple because I'm just start to learn about C language and some code I bring it from another demo game and it's the first time that I use game-editor tool. hope you guys can give me some suggestion :o Thank you :wink:

I also attach file of my project.
Attachments
Quizgame.rar
(396.78 KiB) Downloaded 101 times
NutchanonDotCom
 
Posts: 2
Joined: Wed Sep 07, 2011 3:42 pm
Score: 0 Give a positive score

Re: Problem with quiz game and time count down

Postby skydereign » Wed Sep 07, 2011 11:16 pm

Well a problem with your code is that you aren't using any global variables. You seem to be trying to use certain variables in most of your scripts, but really what you are doing is using separate variables in each script. This seems to be working to some degree, but it is very unstable. So, one major thing to improve the state of your game is to define all of the variables you have in global code. So, at the beginning of each script, where you have Timenum, and question_numberValue, and any others, put those into global code, give the script a name, and add it. Also you'll need to remove all of the variable declarations that you had before.
Global Code
Code: Select all
int Timenum;
int question_numberValue;
// etc
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Problem with quiz game and time count down

Postby NutchanonDotCom » Thu Sep 08, 2011 3:48 pm

I am very new in here, and just start using the program for few days, so, it is very strange but interesting for me to start using this program in developing a game. Thank you @skydereign a lot for a very nice information and kind supporting.

I have another question on the same project, I try to make a Quiz game, as stated. There is a thing I have no idea how to do, even I have searched in this forum and with search engine. I would like to know how to make the program Random the Questions every time it runs.

For example, I have 10 questions, the Question would ask the user to answer with Question No. 3, and then with 7, and 9, and 5 (randomly), but not 3 again, (not the one that already asked).

Any help would be really appreciated.
Thank you in advance :)
NutchanonDotCom
 
Posts: 2
Joined: Wed Sep 07, 2011 3:42 pm
Score: 0 Give a positive score

Re: Problem with quiz game and time count down

Postby skydereign » Fri Sep 09, 2011 1:17 am

So, don't repeat any questions? You'd have to store the which questions have already been asked. Here is a way of picking random numbers so they won't repeat. If you still need help though, feel free to ask.
http://game-editor.com/forum/viewtopic.php?f=1&t=7023&p=50342&#p50342
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest