What is the Beep8 Retro Game Engine?
Beep8 is a tiny JavaScript game engine that makes it easy to build retro-style games right in your browser. It takes inspiration from 8-bit computers of the past, but keeps things simple so you can jump in and start creating.
There’s nothing to install, no heavy tools, and no tricky setup. Just add Beep8 to a page and you’re ready to go. Whether you’re brand new to coding or already an experienced developer, Beep8 is designed to be fun and welcoming for everyone.
The 16-Colour Palette
Beep8 uses a fixed set of 16 colours, just like old-school 8-bit computers. Every game screen is made up of a grid of character cells, and each cell can have its own foreground and background colour.
Instead of drawing images pixel by pixel, you print letters, symbols, or tiles onto the screen. This simple approach is what gives Beep8 games their distinctive retro look and feel.
Here are the colours you can use:
You can read more about the colour palette on the Color Palette Documentation.
Core Commands
Everything you see in a Beep8 game is drawn with a few simple commands. They work like the old textmode computers, but in JavaScript.
beep8.locate(x, y); // move the virtual cursor
beep8.color(fg, bg); // choose foreground and background colours
beep8.print("Hello!"); // print text at the cursor
beep8.printchar("☺"); // print a single character or tile
beep8.cls(); // clear the screen
That’s all you need to start putting text, tiles, and graphics onto the screen. Of course, there’s loads more commands that let you do things like play sound effects, read input, and manage game state. You can find the full list in the API Documentation.
async function main() {
// Clear screen using white foreground (10) over blue background (5).
beep8.color(10, 5);
beep8.cls();
// Print greeting at position 1,1.
beep8.locate(1, 1);
beep8.print("Hello world!\n\n");
// Ask the user's name.
beep8.print("What is your name?\n> ");
// Don't forget: beep8.Async.* functions need to be called with await:
const name = await beep8.Async.readLine();
// Print it back, but in yellow (15).
beep8.color(15);
beep8.print("\n\nHi, " + name + ".");
}
window.addEventListener("load", () =>
beep8.init(main, { NAME: "Hello" })
);
You can see the full code for this example in the Text Input Example.
Maps and Levels
Beep8 includes a built-in tilemap system, which makes it easy to design and display game worlds. Instead of drawing everything by hand, you define your level as a simple grid, and Beep8 handles loading and drawing for you.
You can use JSON to describe your maps, or even plain ASCII text for a retro feel.
########
#@ $ #
# . #
########
Characters in the text map represent walls, the player, boxes, targets, and more. You can then define an array of tile types and their properties. It’s a simple but powerful way to create puzzles, dungeons, and other 2D environments.
You can see an example of this in action in the Sokoban Example.
Music & Sound
Beep8 has built-in support for music and sound effects. You don’t need to load external files — everything is generated live in the browser.
For music, Beep8 can automatically create chiptune-style tracks for you, or you can write your own using a simple text format. There is also a simple music editor that runs in the browser to help you compose tunes.
For sound effects, you can pick from a library of over 100 effects, or design your own with zzfx.
This makes it quick to add retro bleeps and bloops to your games without worrying about file sizes or audio assets.
Runs Anywhere
Beep8 is designed for the web from the ground up. Your games run directly in the browser — no plugins, downloads, or special setup needed.
That means you can share a game with a simple link, and anyone can play instantly on desktop, laptop, tablet, or mobile. On touch devices, Beep8 even shows on-screen controls automatically, so your game is always playable.
Next Steps
Ready to try Beep8 for yourself? Here are some good places to start:
- 📝 Follow the Getting Started guide
- 🎮 Play Beep8 games
- 💻 Explore the code examples
- 🎨 Try the textmode art editor
- 🗺️ Build a map with the map editor
Beep8 is small, simple, and fun to experiment with. Start with a few lines of code, and you’ll be making your own retro games in no time.