Browser games and js13kGames: small games made for the web
Most of the games on FredyGames were written for a machine that is no longer on sale: a console, a handheld, an old PC. To play them in a browser, we run an emulator that pretends to be that machine. A growing part of the catalogue works differently. These games were made for the web itself, so the browser is not imitating anything: it is the platform they were designed for. This guide explains what that means in practice, introduces js13kGames, the competition behind many of them, and takes a tour of the browser games you can play here.
What a browser game is, today
For a long time, games on the web meant plug-ins such as Flash, which browsers have since retired. What replaced them is a set of standard features that every modern browser ships:
- HTML5 canvas, a drawing surface that a script can paint on, pixel by pixel or with shapes and text. It is enough for most 2D games.
- WebGL, which gives the same script access to the graphics card. It draws 3D scenes and lets a game run small programs called shaders that compute colours and lighting directly on the GPU.
- Web Audio, an API that can play sounds but also synthesise them from scratch, with oscillators, filters and effects, the way a hardware synthesiser does.
- WebAssembly, a compact binary format that runs code written in languages such as C, C++, Rust or Python at close to native speed. It is how game engines and whole language runtimes can run in a page.
A game built on these pieces needs no installation and no emulator. It is a web page that happens to be a game, and it runs the same way on Windows, macOS, Linux and, if its controls allow, on phones and tablets.
js13kGames: a whole game in 13 kilobytes
js13kGames is a yearly online competition for games written in JavaScript, organised since 2012 by Andrzej Mazur. Each edition runs for a month, from mid-August to mid-September, and every edition has a theme. The rule that defines it is the size limit: the complete entry, zipped, must fit in 13 kilobytes, which is 13,312 bytes. That has to include the code, the graphics, the music and the sound effects, and entries may not load anything from outside the zip.
To give a sense of scale, 13 kilobytes is smaller than a single photo on a typical web page, and smaller than many web fonts on their own. A long paragraph of this guide, as plain text, already takes up about half a kilobyte.
The themes are deliberately loose, and authors read them in surprising ways. Several of the games on FredyGames come from the 2019 to 2023 editions, whose themes were "Back", "404", "Space", "Death" and "13th Century". You can see each one in the games: Intern Apocalypse sends you back to town for potions; Island Not Found and Soyuz 404 both took their names from the error code; Norman the Necromancer and The Neatness both deal with death, one with spells and skeletons, the other with skulls and gravestones.
How the limit shapes the games
A limit that tight changes how people make games, and the results have a recognisable style.
Graphics are drawn by code. There is no room for a folder of image files, so most entries generate their art when they start: shapes and gradients on a canvas, pixel sprites encoded as a few compact strings, or whole 3D landscapes built from formulas and shaders. Island Not Found is the most striking example here: its island, textures and sky are generated when the page loads, which is why it needs a few seconds to start. Radius Raid draws its star field, glow effects and pixel font in code.
Levels are generated. Procedural generation saves space and adds replay value at the same time. Bounce Back and Space Huggers build each level at random, so no two runs look the same.
Sound is synthesised. Recorded audio is far too large, so entries produce their sound with Web Audio. Small libraries describe each effect as a short list of numbers: frequency, attack, decay, noise, slide. The best known are jsfxr, a JavaScript port of the classic sfxr generator; ZzFX, a tiny sound effect synthesiser by Frank Force; and trackers such as SoundBox and Sonant-X, which store whole songs as patterns of notes and render them in the browser. On FredyGames, Radius Raid uses jsfxr, Stolen Sword uses ZzFX, and Underrun composes its soundtrack with a stripped-down Sonant-X, which is why it pauses for a moment on the intro screen while the music is generated. Intern Apocalypse synthesises its two music tracks note by note from a tiny score of its author's own.
Code is squeezed. Authors minify their JavaScript, shorten every name, and use packers such as Roadroller that compress code further than zip alone can. The source repositories, which many authors publish, are usually perfectly readable; the compressed version is only for the final entry.
Ideas are focused. With room for only a few mechanics, the games tend to have one clear idea, explored well. That makes them easy to pick up and often surprisingly deep.
A tour of the browser games on FredyGames
All of these games run straight in the page. The browser games platform page lists them all; here they are grouped by genre.
Puzzle games
- Black Hole Square (js13kGames 2021): tap arrow squares in the right order to push every square into a black hole, with a strict move limit.
- The Neatness (2022): draw lines through mazes so every skull reaches a gravestone, without joining two of either.
- Super Castle Game (2023): steer a blob of blocks that grows when it touches loose ones, and shape it to fill the marked squares.
- Fire & Fondness 2: a turn-based puzzle game set on a daytime TV show, with flamethrowers, levers and plenty of jokes. It was made with the Godot engine, whose web export runs on WebAssembly.
- Tessel: a calm tile-laying game on square, hexagonal and aperiodic Penrose boards.
- Cube Composer: chain functions such as map and reject to turn rows of cubes into a target shape, a gentle introduction to functional programming.
- And the logic puzzles of Simon Tatham's collection, which have a guide of their own.
Action and shooters
- Radius Raid (2013): a twin-stick space shooter in an arena larger than the screen, steered with the keyboard and aimed with the mouse.
- Starship Sorades 13K (2012): a vertical shooter from the very first js13kGames, with weapon, shield and bomb pickups.
- Underrun (2018): a dark top-down shooter where your gunfire is the main source of light.
- Bounce Back (2019): a top-down roguelite in which your only weapon is a boomerang.
- Norman the Necromancer (2022): hold off villagers with arcing spells and raise the fallen as skeletons.
- Space Huggers (2021): a run-and-gun platformer on destructible planets, for up to four players with gamepads.
- Stolen Sword (2020): a one-gesture action game where time slows while you aim each dash; it works well on a phone.
- SpacePi (2012): draw lines with the mouse to defend a growing base.
Adventures and exploration
- Island Not Found (2020): a first-person 3D puzzle adventure on a whole island. It needs WebGL 2.
- Humwin & Darbold (2021): a little robot explores a purple planet looking for his missing friend.
- Soyuz 404 (2020): a short point-and-click adventure about two cosmonauts lost where even the stars are missing.
- Intern Apocalypse (2019): a small 3D action adventure about the intern who fetches the potions.
- A Dark Room: not a js13k game, but one of the best-known browser games of its decade, a minimalist text game that grows from a cold room into a village and an expedition.
Strategy and programming
- You're the OS!: manage processes, memory pages and I/O as the operating system. It is written in Python and runs in the page through WebAssembly.
- Elevator Saga: write JavaScript that controls a bank of elevators, then watch whether it beats the challenge.
Controls, saves and phones
Since there is no emulator, there is no common key table: each game has its own controls, listed on its page. Many use the mouse, the arrow keys or WASD; a few, such as Stolen Sword, Black Hole Square and Tessel, were designed for touch screens and play comfortably on a phone. Others, like Radius Raid or Underrun, need a keyboard and mouse.
Saves work the way the authors made them. Games that remember your progress keep it in your browser, on that device only, as described in our guide to playing in your browser. Some competition games have no save at all and are meant to be played in one sitting.
A few games need WebGL, or WebGL 2. If one shows a blank screen, check that hardware acceleration is turned on in the browser, or try a recent version of Chrome, Edge, Firefox or Safari.
Why we can host them
FredyGames only hosts games whose authors have given explicit permission to redistribute them, and browser games often make that easy. Each of the games above was published by its author under a free licence: MIT, the GPL, the Mozilla Public License, the Unlicense or Creative Commons Attribution-ShareAlike, depending on the game. Every game page names its licence, links to where the author published it and, when the licence asks for it, hosts the source code alongside the game.
We also make sure each game runs entirely from our own servers. Where an original release loaded analytics, fonts, a language runtime or anything else from another site, the version here has those requests removed or the files hosted with the game, and the game page says what was changed. The games themselves load nothing from other sites.
The details of how we check each licence are in how FredyGames checks every game's licence. And if these compact, clever games appeal to you, the fantasy consoles guide covers another corner of the scene where tight limits produce surprisingly inventive games.