---
title: "Introducing Slime: the old Java slime games, on a phone"
summary: "Twenty-three of the slime sports games that ran as Java applets around the turn of the century, ported to TypeScript and playable in a browser, with touch pads for two players on one phone."
app: "Slime"
address: https://slime.misherate.com
created: 2026-11-01
revision: 1
updated: 2026-11-13
url: https://blog.misherate.com/introducing/slime/at/67374a2110de5b04af0c030f4588165fdfbcd97c
current: https://blog.misherate.com/introducing/slime
---

[Slime](https://slime.misherate.com) is a collection of the slime sports games that ran as Java applets between 1999 and 2007. Each player is a semicircle, the ball is a ball, and the game is volleyball, soccer, cricket, boxing or one of about twenty other sports played under those rules. Browsers dropped Java applets long ago, and that would have been the end of the games. This app runs them again, in an ordinary browser, on a laptop or a phone.

It is for anyone who remembers them, and for two people with one screen and a few minutes.

## How to play

Choose a game from the picker at the top. There are 23. The address keeps your choice in its hash, so a link such as [slime.misherate.com/#soccer](https://slime.misherate.com/#soccer) opens straight into Soccer Slime. Each game has a one-line description under the picker that says whether it is a two-player game or has a computer opponent you can play alone. Most of the sports games have a "World Cup" or tournament mode against the computer.

On a keyboard the left player uses A, W, D and S and the right player J, I, L and K, delivered to the game as Java key events.

On a touch screen each player gets a pad: left pad for the left slime, right pad for the right one, plus a Space button. A finger can slide from one button to the next without lifting. A game that needs an extra key, such as Power in Power Volleyball or Jump in Boxing, shows that key as its own button. Holding the phone upright puts the pads under the game. Turning it sideways floats them over the lower corners. A tap on the game itself counts as a click, which is how the menus inside each game are used.

The page stores nothing and sends nothing. There are no accounts and no online play. The original port had peer-to-peer play through a small server, but that server no longer exists.

## Where it came from

This is the second port. Between 2016 and 2019, [mmkal/slimejs](https://github.com/mmkal/slimejs) scraped the applets, decompiled them, ran them through jsweet (a Java-to-TypeScript transpiler) and cleaned up the output with regular expressions. Its last build, in 2019, contained no games. A newer jsweet produced output those regular expressions no longer matched.

On 1 November 2026 a coding agent revived it from what that repo had committed. The build downloads the 2019 TypeScript at a pinned commit and finishes it with a postprocessor:

- jsweet's overload names (`Thread.sleep$long`) are renamed to plain ones.
- The stub classes jsweet left in place of Java's Applet, Graphics and Thread are removed, so the real ones are used.
- Using TypeScript's parser, every method that sleeps, or calls a method that does, is made `async`, so each game loop's `Thread.sleep(20)` becomes a timer the browser can yield to.

The last step is the interesting one, and it has [its own post](/posts/making-javas-blocking-sleep-async-is-a-fixpoint-over-the). In short, async has to spread up the call graph until nothing changes:

```ts
for (let changed = true; changed; ) {
  changed = false;
  for (const [name, bodies] of methods)
    if (!isAsync.has(name) && bodies.some((b) => callsAny(b, isAsync))) {
      isAsync.add(name);
      changed = true;
    }
}
```

Beneath the games is a small Java runtime in TypeScript: Applet, Graphics, Font, Thread and the event types, drawn on a canvas. It follows Java's real behaviour for arcs, fonts and events, because the games depend on it. Switching games stops the old one without touching its code. Every sleep checks a generation counter, and a sleep started before the switch never wakes.

The canvas is scaled to fit the screen at the device's pixel density, and taps are translated into clicks in the applet's own pixel coordinates.

All 23 games build, and each was played automatically in headless Chromium before release. The built files live in the project's file store, and only a manifest of them is committed, as for every app here that has a build step ([why](/posts/commit-the-manifest-not-the-build)).

## Rough edges

- No sound. The applets' audio clips are silent.
- The applets erase things by painting the background colour over them. Canvas antialiasing can leave faint ghost outlines, so shapes painted in the background colour are drawn a pixel larger to cover them, the same trick slimejs used in 2016.
- In four-slime volleyball the touch pads move one slime per side. The other two need a keyboard.
