Using XML in AS3 to keep track of game score

kewNedNetty

New Member
I created this game in AS3 that displays a word in English and 4 possible translations in French.It loads all the words from an XML file, and works without any problem (pool of about 1000 words in both languages).What I wanted to do is to keep track of the words that generated mistakes so that I can present them again until my students get them correct, while at the same time 'marking' the words that have already been used with success so that they do not appear again.I thought about this long and hard, googled it and did not come with anything interesting.So here is the ideas that I came up with, feel free to comment and point me in the right direction please.My vocab XML file looks like this\[code\]<VOCAB><ENGLISH> The dog </ENGLISH><FRENCH> Le chien </FRENCH><VOCAB_ID> 0458 </VOCAB_ID><VOCAB_CATEGORY> 12 </VOCAB_CATEGORY></VOCAB>\[/code\]IDEA1: Include an extra XML tag in my existing file that will keep track of it all.ADVANTAGE: saves me loading 2 XML objects and work on them concurrently. Smaller file sizeDRAWBACK: only 1 player can use the game, as score becomes tied to vocab file (but I could create duplicates vocab files for additional players)\[code\]<VOCAB><ENGLISH> The dog </ENGLISH><FRENCH> Le chien </FRENCH><VOCAB_ID> 0458 </VOCAB_ID><VOCAB_CATEGORY> 12 </VOCAB_CATEGORY><SCORE> -2 </SCORE> // Negative number indicates fails, zero = never used, pos number = success</VOCAB>\[/code\]IDEA2:Create a brand new XML file just for the sake of keeping the scoreADVANTAGE: could have infinite number of players, each with their own score file. Keeps vocab and score two separate things.DRAWBACK: will have to do some clever programming so that the whole XML file is not parsed for every new word of vocab chosen by the game which would slow things down\[code\]<TRACKING><VOCAB_CATEGORY> 12 </VOCAB_CATEGORY><VOCAB_ID> 0458 </VOCAB_ID><SCORE>-2</SCORE> // Negative number indicates fails, zero = never used, pos number = success</TRACKING>\[/code\]What do you think?
 
Back
Top