Captain Claw, Back in a Browser Tab

writing

Captain Claw was my favourite game as a kid. It is a pirate platformer Monolith made in 1997: you play a cat captain with a sword and a pistol, fighting your way through fourteen levels of soldiers and treasure.

I turned it into a browser game. You can play it at captainclaw.lol: no download, no install, open the page and press Play. Then I added online multiplayer, so you can play it with your friends.

How I did it

I did not rebuild the game from scratch. OpenClaw is an open-source remake of the Captain Claw engine in C++, by pjasicek, that plays the original levels from the original game files. I compiled it to WebAssembly with Emscripten, which turns C++ into something a browser can run, and packed the game files in with it.

Getting it to start was the quick part. Making it feel like the original took longer. The copy of the game files I started from had no sound effects in it, so I merged the original sounds back in. I got the sound and the MIDI music playing in the browser, fixed the screen flashing black between scenes, and moved the controls to WASD so nothing clashes with browser shortcuts. A few friends played the early builds, and the bugs they found, like slippery ledges and enemies attacking too fast, got fixed one by one. It all runs from a Mac I use as a server at home.

The Play screen: the CLAW logo over a parchment skull and crossed swords
The game running in the browser with the settings panel open on the right
Claw holding a barrel over his head in a castle corridor

Adding multiplayer

The original is single player, and I wanted to play it with my friends. Now one person creates a room and gets a six-character code, everyone else types in the code, and you all land in the same level. You see each other's Claw running around in real time with names above their heads, and enemies one of you takes out are gone for everyone. A room holds up to eight players.

Behind it is a small Node.js server that passes each player's position to the others twenty times a second, and the game smooths the movement in between. The multiplayer menu is built into the game itself, in the same gold lettering as the original menus.

The in-game lobby: a room code, two players aboard, the level picker and Start
A thrown powder keg explodes on a stone battlement
Claw fires his pistol on the docks at night
Claw running through the undersea caves
The game running in a browser window at captainclaw.lol
W, A, S and D keys lighting up as Claw runs through a town
Two players in two browser windows, in the same level
Two players running through a purple cavern
Captain Claw, play now at captainclaw.lol

Play it at captainclaw.lol.