UP | HOME

GUERRA-ESPACIAL: an implementation of the spacewar computer game in Common Lisp

This game is inspired by the legendary computer game Spacewar!, created in the sixties by a group of hackers at the Massachusetts Institute of Technology. To create this project I relied in the descriptions of the game and the original code published on the series of articles Inside Spacewar!.

The only feature that this version lacks is the hyperspace jump. The starfield uses the same data that Peter Samson's Expensive Planetarium.

This game can be run wherever McCLIM does, as far as I know this reduces to GNU/Linux; but if your system can run the Xwindow System and a Common Lisp compiler chances are that it can run GUERRA-ESPACIAL also.

You can play Spacewar!'s original code on an online emulator at the following link.

How to run the game

GUERRA-ESPACIAL is written in Common Lisp using McCLIM, an implementation of the Common Lisp Interface Manager, version II.

To run the game, clone this repository in your Quicklisp local-projects directory

$ cd ~/quicklisp/local-projects/
$ git clone https://github.com/josrr/guerra-espacial.git

then:

$ sbcl
This is SBCL 1.4.11, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses.  See the CREDITS and COPYING files in the
distribution for more information.
* (ql:quickload "guerra-espacial")
To load "guerra-espacial":
 Load 1 ASDF system:
   guerra-espacial
; Loading "guerra-espacial"
..............
("guerra-espacial")
* (guerra-espacial:main)

Generating an executable

Also is possible to generate an executable file, just load genexe.lisp:

$ cd ~/quicklisp/local-projects/guerra-espacial
$ sbcl --load genexe.lisp

The file ./bin/guerra-espacial should have been generated. A copy of the executable can be downloaded here.

Keys to play

  • Player 1: w, a, s, d; hyperspace: e
  • Player 2: i, j, k, l; hyperspace: o

Screenshot

guerra-espacial.gif

Credits

Spacewar! was conceived in 1961 by Martin Graetz, Stephen Russell, and Wayne Wiitanen. It was first realized on the PDP-1 in 1962 by Stephen Russell, Peter Samson, Dan Edwards, and Martin Graetz, together with Alan Kotok, Steve Piner, and Robert A Saunders. Spacewar! is in the public domain, but this credit paragraph must accompany all distributed versions of the program.

Author: José M. A. R. R. (jose@rufina.link)

Date: 2019-10-30 mié 20:27

Emacs 26.3 (Org mode 9.1.9)