| Summary: | The "GRE" game has all the nodes with the same words inside of it. | ||
|---|---|---|---|
| Product: | CS3343_Kunkun_Loves_English | Reporter: | xuezhwang2-c |
| Component: | File System | Assignee: | ruixinli7-c |
| Status: | RESOLVED FIXED | ||
| Severity: | critical | CC: | mingyaliu8-c |
| Priority: | --- | ||
| Version: | 1.0 | ||
| Hardware: | PC | ||
| OS: | Windows | ||
|
Description
xuezhwang2-c
2021-11-19 22:36:42 HKT
(In reply to xuezhwang2-c from comment #0) > Summary: > > When I was testing the game, I found that no matter which basketball I > clicked, it always prompt the word "divulge" (specifically, on the screen, > it is "di___ge"). > > Steps to reproduce: > > 1. Enter the login scene and click the button "GRE" > 2. In the playing scene, you may click any existing basketball and the word > appears in the hint board is exactly the same. > > Expected outcome: > > It is expected that the words in the basketball should not only be > different, but also randomly selected from the words list every time we > enter the game. > > Actual outcome: > > The actual outcome is described as above. All the basketballs have exactly > the same word. > > Concern: > > I doubt that this might be the problem of the file system. As in this > system, you will read the file and randomly select some words from the it. > However, it may also be the bug in the Map (game object component). Hi, Xuezhen. Thanks for reporting this bug. Actually, your guess of the bug is exactly correct. It is the bug in the file system instead of the map (in game object system). There is a buggy code in the TxtReader.java and XMLReader.java. The code is wordlist.add(index); We then change to the following: while (sc.hasNextLine()) { WordInfo i = new WordInfo(sc.nextLine(),sc.nextLine()); wordlist.add(i); } which will generate random words which has the same number of words as the number of map nodes. |