Tline Terrain Demo (Worms/Scorched Earth terrain)

Published 2023-06-12


Worms/Scorched Earth deformable/destructible terrain demo.

Arrow keys move target
X to destroy terrain
O to toggle debug mode, showing the vertical slices.

Maybe of use to someone?

For a long time I have wondered how to make Worms/Scorched Earth style terrain and make it work reasonably well. My first ever (unreleased) game on pico-8 was a Worms clone, that used a 2D array of pixels and pset to draw the terrain. It blew the CPU budget and was slooooooow.

Micro Murder on Pico-8 managed a really slick solution drawing circles over the top of the terrain, but I wondered if there was another way. Fast forward some years and I'm still thinking about it. Most discussion about this type of terrain suggests some form of bitmap to store the terrain.

This implementation uses a 2D array of vertical slices, then uses tline to draw a bit of the texture for each vertical slice. An explosion either shrinks one end of a slice, or carves it into two, removing the original slice. See the code for more.

Terrain graphics come from my game The Wizard Pig.