Saturday, January 16

Wolfenstein in 600 Lines of Code

What’s more impressive, the fact that this Wolfenstein-like game is 600 lines of code, or that it’s written in AWK?

AWK is a language primarily used for text processing. But if you can write code the world bows to your wishes. [Fedor Kalugin] leverages the ability of a Linux terminal’s color options to draw his game. The 3D aspect is produced through ray-casting which generates a 2D image from 3D coordinates.

Trying out the game is extremely simple, install gawk, clone the repo, and play:

sudo apt-get install gawk
git clone http://ift.tt/1Ncutjg
cd awk-raycaster/
gawk -f awkaster.awk

We really appreciate the four different display modes which illustrate doing a lot with very little. They include: black and white text, color text, color background, and combination of color text and background. It’s an advanced texture technique with which every ansi artist is familiar.

awk-wolfenstein-textures

Don’t limit yourself to playing with the script and losing interest. Crack that thing open. Try making a spinning wireframe cube based on this framework!

[via HackerNews]


Filed under: linux hacks, Software Development

No comments:

Post a Comment