I enjoy programming little projects on the Microbit and CircuitPlayground because I find it easy to work on them "on the go"! This project meant I was able to start working on a computer, then continue the initial Makecode work using the iOS Makecode app - saving work to Github when switching from PC to phone and back.
It came about because I recently was reading through the Shannara stories, and that lead me to come up with some Microbit programs for this simple "Sword of Shannara" game in python and Makecode.
This is a vastly (!) simplified version of the classic fantasy "The Sword of Shannara."
Screen above shows "you," representing the hero, Shea Ohmsford, who is searching for the Sword of Shannara. You move left/right through a scrolling landscape (100 cells wide) displayed on the 5x5 LED micro:bit screen.
Overhead are dots that represent the "Skull Bearers" (think Tolkien's Nazgul). If you delay when one is overhead, it will attack and you can lose one of your five lives. So either move past quickly, or hit A+B to unleash the Elfstones to eliminate the Skull Bearer. Faint dots along the bottom of the "screen" represent landscape and serve to show your movement left/right.
Somewhere in the middle of the 100-element landscape is the "Sword" represented by three lit pixels.
Game ends when you either lose all 5 lives, or get to the Sword.
Writing this game in MakeCode served as a preliminary "design," which I sketched out AFTER mostly coding the game:
This lead to rewriting the game in Python, using the excellent Microbit IDE - https://python.microbit.org/v/3
Note: If you run the program in the Python IDE, it is hard to "press A+B" so the program also lets you fire the Elfstones with "Shake."
Files
- SwordOfShannara.js - MakeCode Version. Paste into Makecode editor as Javascript, or go to https://makecode.microbit.org/_LHjHeCiaMavM
- SwordOfShannara.py - Python version to enter into https://python.microbit.org/v/3
- SwordOfShannara.hex - can be loaded directly to Micro:Bit or opened in https://python.microbit.org/v/3
NOTE: One thing I find handy with Microbits is buying a switchable holder for a CR2032 coin cell battery or a switchable AAA holder (like https://www.adafruit.com/product/4191). Saves on the wear and tear of plugging/unplugging the Microbit power.
This page (Sword of Shannara on Microbit) was last updated on June 12, 2025.
Text editor powered by tinymce.