Hundreds of Scenes?
Breezeonhold
Member Posts: 187
Hey so as some of you know I'm ATTEMPTING to create a question game. You'll basically see the question and then you'll click a,b,c, or d for the answer. Kind of like a test that you would take at school. This game is to help me get into GS and it's features.
What I really was wondering is if I'm creating this game the best way. What I'm doing is creating a new scene for each question! IS that the best way to make a question game? I'm going to have hundreds of questions and that's ='s hundreds of scenes. Could I some how do this in one scene? What's the best way to approach this game.
What I really was wondering is if I'm creating this game the best way. What I'm doing is creating a new scene for each question! IS that the best way to make a question game? I'm going to have hundreds of questions and that's ='s hundreds of scenes. Could I some how do this in one scene? What's the best way to approach this game.
Comments
JGary321 came up with this neat trick on using a Change Attribute Action for images: http://gamesalad.com/forums/topic.php?id=2939
Keeping that in mind, you could break everything out into individual images:
Question_#.png
Correct_#.png
Wrong1_#.png
Wrong2_#.png
Wrong3_#.png
... where # is the an incremental number for your database of questions.
Try to keep all the sizes uniform across each type of image. The questions images will obviously be big, and the answer ones should be horizontally thin.
Make the Actors: Question,Correct,Wrong1,Wrong2, and Wrong3.
For each question, use the Change Attribute Action to match them all up to the same one.
Place the Question at the top of the screen, then prepare to randomize the positions of the possible answers along the Y axis:
`
RandomLayout = random(1,4)
if RandomLayout = 1, then CorrectY=160, Wrong1Y=120, Wrong2Y= 80, Wrong3Y= 40
if RandomLayout = 2, then CorrectY=120, Wrong1Y=160, Wrong2Y= 40, Wrong3Y= 80
if RandomLayout = 3, then CorrectY= 80, Wrong1Y=160, Wrong2Y=120, Wrong3Y= 40
if RandomLayout = 4, then CorrectY= 40, Wrong1Y=160, Wrong2Y=120, Wrong3Y= 80
`
Then, simply position the 4 answers on the screen.
Of course, you'll be setting up Touch Inside or Mouse Down for each of the answer Actors with the Correct Actor triggering a win.
I hope this works for you, and saves you lots of time from creating a bunch of Scenes.
I love your thinking though, good idea. The lack of arrays still requires much if/then logic if you do it all within one scene that way. Not sure about size of app for many, many images for the text as opposed to "display text" in actors. You still have an actor per question and answers but now you are adding an image, albeit a small one, to each actor (but I'm sure you could deliver a nice looking UI going this route though).