PICO-8
Coding for a retro pixel fantasy console
Nate Drake is in Pixel Town, as he shows you how to code a retro classic-style 8-bit game on the PICO-8 fantasy console.
OUR EXPERT
Nate Drake is a technology journalist specialising in cybersecurity and retro tech. His first foray into 8-bit gaming was Space Invaders at his father’s local. He hasn’t looked back since!
If you can’t afford to pay for PICO-8 or just don’t want to, you can access PICO-8 Education Edition free of charge at www. pico-8-edu. com. This is a free web-based version of the console, which we used to put together this tutorial.
P
ICO-8, released in 2015, pays homage to the golden pixel era of games. It’s a fantasy video game console designed to mimic classic 8-bit systems in a Lua-based environment. The interface not only accepts code but can also be used to design sprites and sound effects. In this guide, we’ll cover how to set up PICO-8, as well as how to design a rudimentary game with collision detection and scoring.
Fire up your browser and head to www.lexaloffle. com/pico-8.php. From here, select the pink button to go to the product page for the most recent release.
From here, choose Get PICO-8. It’s currently priced at $14.99. Ignore this and the Picotron fantasy workstation for now. Enter your email address in the corresponding field, then choose to pay using either card (via Stripe) or PayPal, but we used the free Education Edition for this tutorial (see Top Tip left).
Before diving into scripting language, it’s helpful to see what PICO-8 can do. Fortunately, the console comes with some demo games. To deploy these, run: INSTALL_DEMOS
PICO-8 commands operate exclusively in upper case. Once the demos are installed, you’ll see them in a list. You can switch into the corresponding directory in exactly the same way as from the Linux terminal: CD DEMOS
Next, load the example game Jelpi with: LOAD JELPI
You can now launch the game by entering RUN . This is a charming example of a 2D platformer. You can move the eponymous character around using the arrow keys. Press Z to jump and X to perform a power charge to remove blocks and enemies.
Once you’ve played the game to your heart’s content, press Escape to return to the console. Enter the command CLS to clear the game from the screen.
Your first cartridge
Type REBOOT into the PICO-8 console to start a new cartridge. Next, press the Escape key once again to launch the code editor.
PICO-8 uses an implementation of the Lua scripting language to create games. It’s simple to understand but contains powerful features.
PICO-8 uses a subset of Lua as its scripting language, which has similarities with simple programming languages such as BBC Basic. By way of example, enter the following into the code editor: PRINT(“HELLO WORLD”)