The goal of Chip's Challenge is to collect enough chips to make it to the exit at the end. This involves collecting various keys and boots to allow you to get past obstacles and monsters. Most of the keys are 1-time use except for the green key and boots stay in your inventory unless you step on the thief tile, in which case all collected boots are removed. In the default level set, there are 144 regular levels along with 5 bonus levels that you can only play by using the "Go to level" function along with the appropriate password.
Customizing the Game
This game can be customized in quite a few ways with most of the settings inside of code.py. Below are some fun places to customize the game along with the locations of where to change them.
Changing the Data File
You can choose a different level set by changing the DATA_FILE
variable inside of code.py to point to the file location. This is so that you can have multiple files on the CIRCUITPY drive without needing to overwrite a single file.
Disabling Auto-reload
If you would like to play while having the board connected to a computer, some Operating Systems such as MacOS may periodically write to the drive and reset the game. By disabling Auto-reload, it will prevent the game from resetting. If you do edit any files with this setting active and want to reload, just unplug and replug in the board. You can do this by uncommenting the last two lines in following code inside of code.py. This is done by removing the # from import supervisor
and the line after that.
# Disable auto-reload to prevent the game from restarting #import supervisor #supervisor.runtime.autoreload = False
Additionally, you may just be able to just eject the drive if you don't need to modify files.
Sound Effects
The included sound effects are the same sounds inside of the original game. If you would like to change these to you own, just place you files onto the CIRCUITPY drive and edit the SOUND_EFFECTS
dictionary inside of code.py. Just be sure if you change the keys, to update them in gamelogic.py or the game will not run properly.
Playing Without Sound
If you would prefer the sounds don't play, you can change the PLAY_SOUNDS
variable inside of definitions.py to False.
Timing Constants
If you would like to change the timing constants for the game, which control the speed of the game, you can change the TICKS_PER_SECOND
and SECOND_LENGTH
variables. Because of the limitations of the microcontroller, attempting to speed up the game likely won't have much effect, but slowing it down would in case you need to get past a section with tight timing.
Savestate File
If you would like to change the filename of the savestate file, you can change the SAVESTATE_FILE
variable inside of savestate.py. By default, this is chips.json, but could be renamed to something else to allow switching between multiple savestate files. If you would like to edit or backup the savestate file, you can place the SD card into a computer and open the file for editing. However, be certain you are using valid JSON or the file will be overwritten.
Hotkeys
The game is played using the arrow keys as well as a few other hotkeys. A hotkey is just a keyboard shortcut to perform an action. Here are the ones used during normal gameplay:
- Ctrl+R: Restart Level
- Ctrl+N: Next Level
- Ctrl+P: Previous Level
- Ctrl+Q: Quit
- Ctrl+G: Go to Specific Level
- Spacebar: Pause/Unpause Game
When typing in passwords to go to a specific level, you can press the TAB key to go to the next field.
Passwords
Levels can be unlocked with passwords. If you would like to jump to a specific level, you can find lists of passwords around the web.
Custom Data Files
If you would like to play levels beyond the included ones, a web search will yield many options. To play these custom level, just copy the files to the CIRCUITPY drive and edit the DATA_FILE
variable in code.py to point to the correct file location.
Editing Data Files
If you would like to create or modify your own levels, there are a number of editors available that allow you to make your own level sets or modify any existing ones.
Possible Issues
It's possible you may encounter a PYSTACK exhausted error and the solution to that is to go into the settings.toml file and increase the value of CIRCUITPY_PYSTACK_SIZE
. I tried setting it at a reasonable value, but increasing this value too much could result in having too little RAM to run the game.
If you find a bug and would like to submit a fix, the files can be found inside of the Adafruit_Learning_System_Guides repository on GitHub.
Improvements
This game could likely be further optimized just by using displayio as many of the things handled manually could be implemented with displayio such as the partial screen updates and better use of controls such as buttons and text boxes. This was left out due to time constraints as well as needing some additional features that were not currently available in the libraries such as the dialogs themselves.
Page last edited April 09, 2025
Text editor powered by tinymce.