· 5 min · Original
Build a retro handheld game with Codex and ModRetro Chromatic
Loading article…
With all due respect to the iPhone, the Game Boy might be the most iconic handheld device of all time. A generation of kids stomped Koopas on the bus and shared a link cable to battle their friends in Pokémon, with a device that brought games somewhere they’d never been before - your pocket. Or at least a pocket of your backpack.
With today’s powerful coding models, and tools like Codex, building your own games has never been easier (or in my opinion, more fun). But there’s something special about a game running on purpose-built hardware, like the Game Boy Color, that’s hard to replace. That’s why I am sooo excited to share that the ModRetro plugin for Codex enables anyone to build and play real Game Boy Color games on a handheld device.
You can order your own special edition ModRetro Chromatic device here.
Let’s jump right in and explain how it works.
With the plugin selected in your Codex chat, describe the game you want to build. To follow along with the video, use this example prompt.
Build a top-down adventure game called Lodge Podge where a pixel beaver must chew down small trees to gather sticks to build a lodge in the center of the level.
Next, ask Codex to build the game and open the preview. You can also ask it to point you to these files in your GB Studio project folder.
.gbsproj file in GB Studio to edit scenes, actors, and events.assets/ for the sprite sheets, backgrounds, and audio used by the project..gbc file in an emulator or install it on a cartridge.From here, the hard part is up to you - prompting and iterating with Codex to figure out how to make the game fun. For example, I iterated on Lodge Podge a few times with prompts to make the beaver more chonky (for maximum cuteness), and to require gathering more varied resources, like mud and leaves, to help build the beaver lodge.
The ModRetro Chromatic plugin contains developer tools the model can use on your behalf.
Ask Codex to create a sprite sheet and show you the frames side by side. To revise the animation, identify the pose or direction you want to change, then ask Codex to rebuild the preview.
Ask Codex to show you a scene’s background and collision map side by side. The collision map marks which tiles block movement. Use the background to identify the area you mean, then tell Codex which tiles to mark as blocked or walkable.
Ask Codex to open the game preview in its built-in browser. Use the arrow keys for the Game Boy’s D-pad, Z for A, X for B, and Enter for Start. Use the toolbar above the emulator to pause or resume.
Choose Annotate game in the preview toolbar, then click the game display to freeze a frame. Select the sprite, tile, or area you want to change and describe the edit. Choose Resume game to return to the emulator. After Codex makes the change, ask it to rebuild the ROM and reopen the preview.
You can also control the emulator from chat. Ask Codex to run the ROM, send a sequence of button presses, and capture a frame after each step. Ask for the frames side by side so you can inspect them together.
GB Studio is a visual editor for building Game Boy games. Open your project’s .gbsproj file and choose Game World. Select a scene in the navigator to see its properties in the sidebar. You can drag an actor to a new tile or edit collisions directly on the scene. Save the project, then return to your Codex chat and ask it to rebuild and open the preview. The GB Studio guide to scenes explains how backgrounds, actors, and triggers fit together.
lcc compiler. GBDK’s Game Boy APIs give you access to buttons, sprites, tiles, and palettes. Ask Codex to start with a game loop that reads the D-pad and moves a single sprite..gb or .gbc file to the plugin to inspect and playtest.You’ll need a Chromatic, a compatible rewritable homebrew cartridge, and a USB data cable. Follow ModRetro’s quickstart to update the firmware and activate Developer Mode using the computer you’ll connect to the handheld.
With the ModRetro plugin for Codex, you can prompt your way to original Game Boy Color games and use all the tools in the thriving GBC homebrew development ecosystem. This is going to be so, so much fun. You can order your own ModRetro Chromatic device here and learn more about ModRetro and its other incredible work here. Happy Game Boy hacking!