so_long

A larger map: a maze of cacti in the sand, with five water drops scattered about and the dinosaur in the middle

The demo needs JavaScript. Here is what it shows.

Commands

Move
Exit

Loading the module…

Theme

Choosing one restarts the program.

Map

Choosing one restarts the program.

How it works

What runs here

The so_long program written in C, compiled to WebAssembly with Emscripten. Nothing was rewritten in JavaScript: the map parser, the movement and the rendering are the project’s own code, started with the same arguments as in a terminal.

What had to be adapted

so_long draws through MiniLibX, which needs an X11 window. A browser has none, so a small replacement library with the same functions draws into this page instead, listens to the keyboard and reads the XPM textures.

What differs from the original

The browser drives the loop, capped at 60 frames per second. Maps and textures are packed into the binary, and each game is a new instance of the program. The map_16x9 map was drawn for this page, in the shape of the stage.

This version adds themes and a two-state exit to the submitted program, available at the tag v1.0.