JD-pyprocgame
JD-pyprocgame copied to clipboard
Wrong number of shots displayed in BattleTank
The number of completed shots displayed is wrong if BattleTank is played twice within the same ball. The number of shots is initialized to zero when the mode is created at the start of the ball, but it is never cleared afterwards causing the count to just keep growing. This also silences the voice callouts because the sound file is not found. Luckily, the mode can still be completed normally because the completion depends on a set of 3 boolean flags which are correctly initialized.
The solution is to set self.num_shots to 0 in mode_started() instead of the constructor.