In need of help! Counting Items
Huma
25 Apr 2014, 08:28Hello!
I am creating this game for a friend of mine and the deadline for his project is approaching!
What I want to do is ask people a series of questions and based on their answers map them to a certain person. Just like a personality quiz. What I had in mind was to add an object to the inventory whenever they answered and in the end count those objects to see which objects has been added the most. Sadly I am not sure how to do this.
Any kind help would be appreciated a lot! Using dictionaries and lists is always an option as well If I can understand how to manipulate the data and reach to the variables.
Thank you,
huma
I am creating this game for a friend of mine and the deadline for his project is approaching!
What I want to do is ask people a series of questions and based on their answers map them to a certain person. Just like a personality quiz. What I had in mind was to add an object to the inventory whenever they answered and in the end count those objects to see which objects has been added the most. Sadly I am not sure how to do this.
Any kind help would be appreciated a lot! Using dictionaries and lists is always an option as well If I can understand how to manipulate the data and reach to the variables.
Thank you,
huma

jaynabonne
25 Apr 2014, 09:25Going the "object in inventory" route would be more complicated than just having int attributes on the player (or some object) as counters which you increment in response to the questions. Then you can just check the counts directly when they're done with the interrogation.
e.g.
init:
game.pov.emo = 0
when they answer in an emo way:
game.pov.emo = game.pov.emo + 1
Then check the count when done.
e.g.
init:
game.pov.emo = 0
when they answer in an emo way:
game.pov.emo = game.pov.emo + 1
Then check the count when done.