I’m trying to learn how to make Roguelikes in Common Lisp. I’m slightly following in the footsteps of Steve Losh’s impressive Silt, though I expect this to veer off in unexpected directions.
Right now I’m mostly figuring out basic Common Lisp and curses
stuff, without worrying too much about what the game will become.
It probably only builds and runs on Mac so far. First, set up your Mac with SBCL. My notes for that are here.
Then,
make # to build ./loam # to run
Moving:
y k u h.l b j n
Hitting the q
key quits the game.
It’s pretty self-explanatory after that.
screen.lisp
sets up a CLOS-based screen abstraction implemented both
with curses
and with a more REPL-friendly print-only version that
outputs screen operations for cross-checking behavior prior to running
with the curses
version.
Evaluate the commented-out form at the bottom of main.lisp
to see
the REPL-only behavior.
To jack into a REPL running in the terminal (i.e. outside of Emacs),
rlwrap sbcl --eval "(ql:quickload '(:swank) :silent t)" \ --eval "(swank:create-server :port 5555 :dont-close t)"
then in that REPL run
(loop (sleep 1))
Then, in Emacs slime-connect
to localhost:5555
. You should be able
to produce curses
output from the Emacs REPL then.
- Add random motion to beings
- Draw a little bit of tooltip text when objects are encountered
- Start thinking about some simple game play