Cooking with Linux - Exciting Arcade Action in Glorious ASCII
Three frames per minute? Yes, François, I would call that pretty bad performance. While I admire your desire to reuse old hardware to build your Linux desktop, I have to say that your new system might be a little underpowered for running FlightGear. Of course, mon ami, it is a great game, but you need a more powerful system and an accelerated 3-D graphics card. Now, don't look so sad, François. Our guests will be here shortly, and tonight's menu features some great games that you can run on the most basic of systems. Non, you must wait until our guests arrive.
Mon Dieu! They are approaching as we speak. Prepare yourself, François. Welcome, everyone, to Chez Marcel, home of fine wines and excellent Linux and open-source software. Our wine cellar, as you know, is one of the world's finest, and yet, even our selection pales in comparison to the number of great open-source projects. Luckily, there is a wine for all packages. Please sit, mes amis, while François makes his way to the wine cellar. Please, François, bring back the 2002 Chassagne-Montrachet “Champ Gains”. While we wait for the wine, let's talk about great gaming action with minimal resources.
Playing fast-paced arcade games doesn't necessarily require high-end hardware. In fact, you can find games that don't require a graphics card at all. I know what you are thinking. Chef Marcel has been sampling a little more wine than usual today. Although that may be true (a little joke, non?), it hasn't clouded my judgment. The items on tonight's menu are all text- or ncurses-based games, and all you need to play them is your Linux system and an open terminal window. Now, you aren't likely to find most of these packages in your favorite distribution's repository, but never fear. Given the simplicity of these packages, you'll find they pretty much compile without fuss and without the need for a lot of extra libraries—just use the extract-and-build five-step.
Way back when your humble Chef spent his hard-earned quarters at the video arcade, he particularly enjoyed defending Earth from invading aliens. The year was 1978, and the game was Space Invaders. Even today, Space Invaders is still a hugely popular game. I actually ran across two versions of the old Space Invaders game—one somewhat more text-heavy than the other. The first is Thomas Munro's ASCII Invaders (Figure 1). This one is definitely the textiest (is there such a word?), and it's very true to the spirit of the original game. Visit his site at www.ip9.org/munro/invaders/index.html.
My guess is that I don't have to tell you how to play this game. There's a gun platform at the bottom of the screen that you move left and right with cursor keys. Press the spacebar to fire and try to get all the aliens before they come down and blow you away. Occasionally, flying saucers will sail overhead. These are worth more, so make sure you get those when you can. It's easy to play, but hard to win. Keep moving and stay alive long enough to fight the next wave.
Before we move on to the next text-based game, let's look at yet another Space Invaders clone, mostly because it's handled a little differently to provide alternative graphics. This one is called nInvaders (Figure 2), and it comes to us from Thomas Dettbarn and friends over at ninvaders.sourceforge.net.
Do you remember a game called Boulder Dash and its hero, Rockford? The premise of the game involved a prospector searching for diamonds and other gems underground (another, similar game available for your Linux system is Rocks & Diamonds). To get to the gems, our hero needed to dig his way through the ground, avoiding falling rocks and cave-ins, both of which spelled certain doom. Tom Rune Flo's very cool Cavez of Phear (Figure 3) is available from www.x86.no/cavezofphear.
To start the game, run the program, phear. An ASCII underground cave system will be created for you, complete with diamonds located in hard-to-reach places with boulders ready to cave in on your Z-head if you aren't careful. The game screen tracks your score, lives and, most important, the number of diamonds you need to collect in order to advance to the next screen (Figure 4).
Cursor keys let you navigate through the caves. If you get totally trapped in a cave, which can happen with a cave-in, pressing the K key provides you with an easy way to commit suicide (your ASCII self, not you). Collect bombs (which appear as % symbols), pressing B to place them and T to detonate them. Bombs, as I'm sure you know, can help you get out of otherwise impossible situations. Oh yes, there also are the monsters (shown as letter Ms). Whatever you do, don't let the monsters touch you, because they will kill you. Did I mention that Cavez of Phear even has sound? Simply press S to toggle sound on and off.
The final item on tonight's menu is a bit of an overkill when it comes to ASCII games. Featuring client/server network play, complex, fast-paced 16-color animation, multiple weapons, exploding characters and gushing blood, the aptly named Overkill takes ASCII games to their sane limit. Written by Karel Kulhavy, Petr Kulhavy and others, Overkill promises that “you'll learn what a horror man can see in ASCII”. You'll find Overkill at artax.karlin.mff.cuni.cz/~brain/0verkill. Of the games mentioned here, Overkill is the one game you might find in your distribution's repositories. If you are using Ubuntu Linux, for instance, you can install it with apt or Synaptic. The site also provides binaries, if you don't want to compile the program.
Because this is a client/server game, you need to start by running the server program. In the packaged version, the program is actually called overkill-server. Now, open up another terminal window and run the client, a program called 0verkill (overkill in the package). The startup screen scrolls some interesting statements at the bottom and gives you a hint of what you can expect (Figure 5).
All you need now to start the game is to connect to a running server, press S, then enter the hostname or IP address. Overkill comes with both male and female characters. Those characters, in turn, can be customized by giving them a unique color scheme. To change the color, press the up or down arrow while at the connect screen. To change from male to female, cycle through the 16 colors. Once you have selected a character, press the N key to give it a name.
Everything is controlled via keystrokes. Press the left and right arrow keys to move left and right. Press the up key to jump or climb. As you work your way through the various levels, you'll collect weapons and ammunition; to use a different weapon, press the 1, 2, 3, 4 or 5 keys. If and when you get killed, an event that occurs in truly gruesome, blood-curdling ASCII, you can respawn your character by pressing the spacebar. If you get stuck, press H for a handy help menu. You can still have fun playing on your own, but to get your heart really pumping, invite a friend (or two or three) to connect for great multiplayer action (Figure 6). The game even remembers what has come before, as you'll notice when the corpses start to pile up (shudder). It's great, heart-thumping and fast network fun.
Speaking of fast, is it possible that time has gone by so quickly? Mon Dieu! It is nearly closing time. Perhaps we can convince François to refill your glasses a final time, which will give you just enough time for another ASCII deathmatch, with or without aliens, before you go. Raise your glasses, mes amis, and let us all drink to one another's health. A votre santé! Bon appétit!
- October 2014 Issue of Linux Journal: Embedded
- Give new life to old phones and tablets with these tips!
- Encrypt Your Dog (Mutt and GPG)
- Practical Tiny Core in the Fire Service
- DevOps for Dummies
- Tech Tip: Really Simple HTTP Server with Python
- Cooking with Linux - Serious Cool, Sysadmin Style!
- Returning Values from Bash Functions
- New Products
- RSS Feeds
Free DevOps eBooks, Videos, and more!
Regardless of where you are in your DevOps process, Linux Journal can help!
- Linux Journal