Friday, February 26, 2010

Generala updated to v1.4

 - Bug fix: Incorrect Bonus Yahtzee points
 - New feature: Undo a point selection

This revision started with a bug report -- I wasn't adhering to the proper rules of Bonus Yahtzee.  I double-checked to confirm that was true.  This didn't take too long to fix, and while I was doing it I noticed a second comment crop up about the lack of undo.  I'd known of that for a while and decided to take a look while I was tinkering.

Implementation wasn't as bad as I was worried about, though it does touch a number of scattered pieces of logic.  The PlayerData object tracks your previous move, clearing that value between turns.  The button handler checks if that's set to something valid and will remove the previous move and execute the new one as needed.  There's some odd corner cases due to the way I handle Bonus Yahtzee, but that got worked out after some testing and iteration.

Now that it's done, you can click on as many valid score selections as you want before hitting next turn, and it'll reassign your points appropriately -- including updating the title bar.  If you click a score, then click the same one a second time, it'll take the score away entirely and you can proceed to reroll.

So, a bug fix and a new feature.  Enjoy!

No comments:

Post a Comment