• Quick Hacks

    Arduino Enigma06/15/2015 at 03:19 0 comments

    Shortly after doing the first port, I had a realization. The "Game Over" screen was using the LCD libraries to display text in high resolution. This would never be able to be ported back to the original one pixel pacman game.

    I found a c file for a 3x5 font and imported it to the arduino project. I also took some of the Seeed Studios TFT library functions to display text and changed it so it displays this font using the panel pixels. Now there is a unified mechanism to display text in the LCD and original 32 x 32 panel.

    While I was doing this, might as well implement other features as well. The updated game now:

    -pauses before starting a new life.

    -at the end of the game, it displays in decimal, the current score, and alternates between the high score, and the initials of the high score player.

    -if the current game sets a new high score, the player's initials are captured in a new screen. The player has 45 seconds to enter the initials.

    -This data is saved to eeprom in duplicate, so data corruption if power is lost during a write can be detected and the last good data reloaded.

    -Touching the screen or pushing a button re-starts the game.

    All of these features were implemented without changing game logic file, but rather by introducing code in the external functions the game calls when a life is lost, when the game is over, and the control function that reads the player input.

    These changes should be able to be back ported to the LED display.

    The updated files are uploaded to the Google Drive linked on the left.