Weekly BuGS Update Time Again

This week, I only got a couple evenings to work on the code but I was able to implement all of the score code.  When a bug is shot, the score goes up by the “right amount”.  The score is held in two different formats.  One is a 32-bit unsigned integer which is pretty easy to update.  This representation will be used for things like “when the score is >= 60000, the fleas drop faster”.  The other representation of course is a sequence of tiles which have digits in them.  So, when an amount is added to the score, I do the add to both the 32 bit integer and I add the same amount to the tiles.  I don’t try to turn the 32 bit integer into a decimal number because I suspect it is faster to just do the add twice but it does mean I could have a bug in one or the other add routine and the two representations of the score could deviate from each other.  But hopefully not…

I still want to rough out all of the game logic which iterates through all of the levels and starts with the right colour and the right number of segments moving at the right speed.  I can also add the logic for driving the speed of the other bugs based on score thresholds now that I have a score.

The other news is that I am the proud winner of an eBay auction for an ADB trackball and it is currently in Denver making its way to me.  Once that arrives, I will suddenly have a bunch of incentive to start implementing the player…

Source Code

Changes

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.