views:

42

answers:

1

Hello.

I want to create a very simple game for school. The user chooses answers based on questions, at the end the software presents some choices to the player based upon what they said. They have to choose food they like to eat, and the game tells them about the diet, they have 9 choices.

I wonder how I should keep track of what they player chose, and how to come up with the result based upon those choices. I made it with a score, so each answer had a value, but various arrangements of answers had the same score. I'm new to Flash and Actionscript 3, I understand conditionals and variables but am unable to piece the logic together for this in my head. :)

Help would be good. I want to make this over the weekend and take it to class on Monday. :)

Thank you.

A: 

The logic of your game is language independent. Instead of focusing on AS3 , draw a basic flow chart. Start simple , beginning of the game , end game , add elements to it. This should give you some form of structure and a bunch of objects like Player , Choice etc... At this point you should be able to create some classes for your object & establish some form of relationship between them.

If you're new to Actionscript 3, I suggest viewing the following:
http://tv.adobe.com/show/colin-moocks-lost-actionscript-weekend/

It is a lot to view over the week end , but the format allows for a bit of fast forwarding :)

PatrickS
Hello. Thanks, that makes sense. kubarum's comment about ArrayCollection made me think of using an array, for each answer put a variable in an array, an identifier of sorts. When the end comes and the game displays the diet info, it would run through that array and perform an action on each, using a foreach probably :)
Peter
Or, a way that would work would be to say... if array contains more 0's than 1'a, do this, else do this. That would work, I need to learn how to query an array now :)
Peter