Hundreds of Scenes?

BreezeonholdBreezeonhold Member Posts: 187
edited November -1 in Working with GS (Mac)
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.

Comments

  • rebumprebump Member Posts: 1,058
    Currently, I'm thinking that is the best way. It would keep the logic per scene to a minimum rather than trying to accommodate many questions in a scene without the availability of arrays. Since the logic would be pretty much repeatable, create the initial scene and dupe from there just updating the question/answers and the attribute that holds the answer to compare the player's selected answer to.
  • BreezeonholdBreezeonhold Member Posts: 187
    Yeah right now I'm working with 8 scenes of questions and making sure everything works like the questions are random. Once I finally get that working I'll just have to duplicate the scenes.
  • ORBZORBZ Member Posts: 1,304
    tree graph
  • BeyondtheTechBeyondtheTech Member Posts: 809
    In thinking about this for a minute, I think I actually came up with a unique way that could make you do all this IN JUST ONE SCENE.

    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.
  • rebumprebump Member Posts: 1,058
    Still think you will have a lot of if/then logic with that approach BTT, which is something that is slow to manually update in GS (the slow scrolling and expression entries) when it is layered deep as opposed to just copying the scene and editing a few items at the top level.

    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).
Sign In or Register to comment.