Our game that provided shuffle text and user might need to differentiate the correct words and wrong words which relevant to the image. User tap on the correct words to gain their healthbar, while if user tap on the wrong words to lost their point in the healthbar. For shuffle text, I have to use two array to store the good words and the bad words. Then I will shuffle them and randomize them to display on the stage.
In the research of my coding, I found a website consist a clear tutorial on the Array and how it function.
and the other link.
Therefore, I have tried to shuffle on One Array. Then I also found the other tutorial to random shuffle on the good Array and the Bad Array which exactly the source that I want.
However, I have tried alot of testing about the array, but the result always failed. Therefore I have think about the backup plan, is to put each of the text in one frame by one frame and gotoAndPlay each of the words to display. But it is very inconvenience and very hard to differentiate which the correct and wrong function and the symbol inside the flash might not easy to handle. Therefore, I asked the Yi Wei about the code which posted in below.
The link that Yi Wei has gave me.
I will try my best to understand it.




No comments:
Post a Comment