Quiz: Help please?
natclarke
Brisbane, AustraliaMember, PRO Posts: 243
I am designing a baby quiz to determine if the mother to be is having a boy or a girl.
There will be 25 questions (one on each scene).
On each scene there are 2 answers : One for a boy and one for a girl.
How do I create it so that it calculates what the person picks and shows a % of chance of having a boy or a girl on the final scene?
Any assistance would be appreciated.
regards
Natalie
There will be 25 questions (one on each scene).
On each scene there are 2 answers : One for a boy and one for a girl.
How do I create it so that it calculates what the person picks and shows a % of chance of having a boy or a girl on the final scene?
Any assistance would be appreciated.
regards
Natalie
Nat Clarke
Life Cleansing
Comments
@natclarke
Hi Natalie, basically you need two integer attributes, let's call them BoyScore and GirlScore. Two buttons on each scene, in the Rules each, put:
When touch is pressed
Change Attribute BoyScore to BoyScore +1
---and in the second one
When touch is pressed
Change Attribute GirlScore to GirlScore +1
Make another attribute, text this time, called Gender
At the end of the quiz, in Rules somewhere:
When BoyScore > GirlScore
Change Attribute Gender to Boy
Otherwise
Change Attribute Gender to Girl
----
The above assumes there will be an odd number of questions....
That's roughly it, hope it helps.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Greatly Appreciated!
Nat
Nat Clarke
Life Cleansing
I have done this so far:
two integer attributes, let's call them BoyScore and GirlScore. Two buttons on each scene, in the Rules each, put:
When touch is pressed
Change Attribute BoyScore to BoyScore +1
---and in the second one
When touch is pressed
Change Attribute GirlScore to GirlScore +1
Make another attribute, text this time, called Gender
At the end of the quiz, in Rules somewhere:
When BoyScore > GirlScore
Change Attribute Gender to Boy
Otherwise
Change Attribute Gender to Girl
Nat Clarke
Life Cleansing
You keep track of the score with a game attribute such as game.Score (type integer or index). Each time the player answers correctly, do Change Attribute game.Score to game.Score+[button value].
On the final page, add an actor with a DisplayText behavior, click on the expression editor (the 'e' button) and type this: floor(game.Score/game.PossiblePoints*100).
You can substitute an actual number for game.PossiblePoints if you prefer. Floor rounds the number down, while Ceil rounds it up. You can also concatenate a percent symbol by typing the formula above and adding .."%" after it (include those two periods).
Nat Clarke
Life Cleansing
Nat Clarke
Life Cleansing
question, Answer A and Answer B and an integer column called Solution (Either a 1 for a girl and 2 for a boy in the column)
On the scenes I have two possible the questions and answers submitted. ie.
The ring moves:
side to side (It is a boy)
in circles (It is a girl)
Next to each answer there is a white baby footprint to press. I would like to link it to my table rather than manually going in change the image to a blue or pink footprint if the answer is related to either a boy or girl.
How would I go about doing that? I have been searching on tutorials for 5 hours!
Thanks
Natalie
Nat Clarke
Life Cleansing
One way to change the image is to have two images in your library called 1.png and 2.png. Then, do Change/Constrain Attribute self.image to tableCellValue(TableName,Row,"Solution"). If the value in the "Solution" column is 1, it will show 1.png, if 2 it will show 2.png.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
)
(Joking!!)