Trench Run Screensaver
Trench Run is a free, in-browser screensaver of an X-wing screaming down a Death Star-style trench toward the exhaust port, with lasers flying and walls blurring past. It renders in real time with no download or install. Press ESC at any time to exit.
How the Trench Run screensaver works
The trench is drawn in one-point perspective: the two walls and floor are filled triangles that all converge on a single vanishing point set at 40% of the screen height, where a soft blue glow marks the exhaust port you are racing toward.
A set of 16 ribs scrolls toward you to create the sense of speed. Each rib's position is squared before placement, so they bunch up near the vanishing point and spread out as they rush past — the natural look of perspective. Your Speed setting controls how fast they scroll, and faint greeble blocks are stamped on alternating ribs for surface detail.
The X-wing is drawn in the foreground from simple shapes: four glowing engine dots, four swept S-foils that flex with a sine wave, red cannon tips, and an elliptical fuselage. It bobs gently left-right and up-down on layered sine waves so it never sits perfectly still.
When Laser fire is on, red and green bolts spawn at random from the lower corners and streak toward the vanishing point as short bright segments, fading out as they reach the distance.
Wireframe trenches and one-point perspective
The trench-run sequence is one of the best-known set pieces of the 1977 film Star Wars, and it has a computer-graphics history of its own. The Death Star briefing-room animation was made by Larry Cuba on a Vector General 3D terminal driven by a PDP-11/45, programmed in the GRASS language, and it is an early example of wireframe computer animation in a feature film.
Atari's Star Wars arcade game of 1983 used colour vector graphics, drawing bright lines directly on the screen, and its final phase had the player flying down the trench to fire at the exhaust port. Wireframe vectors suited the hardware of the time, which is why the look became associated with that era.
The reason a trench is so convenient for programmers is geometry. Lines that run parallel to your direction of travel, such as the tops and bottoms of the walls, appear to converge on a single vanishing point. This is the foundation of one-point perspective. A corridor needs no complex 3D engine, because motion can be faked by sliding evenly spaced features toward the viewer. This is an homage, not a game, and the picture here is a stylised piece of programming rather than a reproduction of anything from the film or arcade original.
A worked example
With the defaults — speed 5, wall #4a4f59, lasers on, space #02030a — an X-wing weaves down a gray trench under a strip of stars, ribs rushing past toward a glowing exhaust port while red and green bolts streak ahead. Push Speed to 10 for a white-knuckle run, or turn Laser fire off for a quieter approach.
Settings & tips
- Raise Speed toward 10 to make the ribs blur past for a high-velocity attack run, or lower it for a calmer glide.
- Toggle Laser fire off if you prefer the trench without the red and green bolts streaking ahead.
- Recolor the trench with the Wall color picker and set the Space color for the strip of sky above the trench.
Frequently asked questions
- Is the Trench Run screensaver free?
- Yes. Trench Run runs free in your browser with no download, install, or account. It starts the moment the page loads.
- How do I exit the Trench Run screensaver?
- Press the ESC key to exit at any time and return to the page.
- Can I turn the lasers off?
- Yes. The Laser fire toggle removes the red and green bolts so you get a clean flight down the trench.
- Is this an actual Star Wars game?
- No. It is an original animated tribute to the Death Star trench-run scene and is not a playable game or an official Star Wars product.
- Does Trench Run work on mobile and Mac?
- Yes. It runs on an HTML canvas in any modern browser, so it works on Windows, macOS, Linux, and phones with no plugin.
- Why do trench walls seem to rush faster at the edges?
- Things close to you move across your field of view faster than things far away. Features near the screen edge are the closest, so they appear to speed past while those near the vanishing point barely move.
- What is a vanishing point?
- It is the spot where parallel lines running away from you appear to meet. Artists and 3D engines both use it to create depth on a flat surface.
- Was the original arcade game made with wireframes?
- Atari's 1983 Star Wars arcade game used colour vector graphics, which draw bright lines directly on the screen rather than filling pixels.