GB game yeeaahh! This game is perfect in it's simple but fun gameplay. I was only able to get a little over 50 so I'll have to work on my customer service skills. I liked the increasing difficulty, graphics, and the buckos moving around for each order. I wanted to get the leading 0s for the score in my game so that's something I was curious about.
Thank you!
GBDK comes with a data type to store numbers as binary-coded decimal (BCD) and do math with them. Each digit of the score is converted to binary seperately and stored in half a byte / nibble e.g. 56709 would be converted to
0101 0110 0111 0000 1001
This representation makes it easy to map the digits to the tiles to be used for drawing (if they are contigious), extract each nibble and add the start offset for the tiles to it.
GBDK uses 4 byte to represent a number in BCD format, representing 8 digits.
A score of 56709 would actually be stored as
00000000 00000101 01100111 00001001
To get the leading zeroes, one then just converts the whole Score in BCD to tiles and it would be formatted to be 8 digits, 00056709.