nguyen-fran / Stratego

0 stars 0 forks source link

Graveyard Bug #1

Open EmilySVo opened 3 years ago

EmilySVo commented 3 years ago

Although the human player’s graveyard updates when a piece is lost, the computer player’s graveyard does not update. When the human player gets rid of the opponent’s player, the graveyard value remains 0. I believe this bug originates from the local game code where graveyards are updated. During debugging, I found that capturing a piece as the human player does not call line 159 at all. This means it skips over updating the graveyard for the computer player. I will further investigate this bug and post the solution later if I find it.

EmilySVo commented 3 years ago

So I went into the debugger and it does show that the redGY array is updating, but it's having trouble updating on the text view. The problem is most likely in your StrategoHumanPlayer then. During that debug, it did not call settext for the redGY. I will update you if I find the reason why. Capture

EmilySVo commented 3 years ago

So, it does seem like some of the graveyard is updated. Only the characters of 5, G, 7 and the bombs update. My recommendation is to review your code in StrategoHumanPlayer when it updates the textview. I believe there may be a problem with the for loop created. It doesn't seem to always access that for loop and run it to update the numbers.