ALAN Interactive Fiction
A First Example Game for New ALAN Programmers
One game, two flavours
These two ALAN source-code examples show the same little interactive fiction game written firstly without, then with the use of the Alan standard library. The first game illustrates the basics of the Alan IF Authoring system, while the second shows the more practical way of building a game on top of the foundation provided by the ALAN standard library.
These example files are intended to show people how to use ALAN to write interactive fiction games. They're short, less than ten pages each, but do contain a lot of words. If you mind works like mine, you might find it easier to digest if you print them out to read off paper rather than on-screen. The information is just the basics for the first few days learning ALAN. The Alan Adventure Language Manual (3MB PDF file) contains all the detail about Alan. There's a lot to study in there. Read the first three chapters along with these two code samples to get a good grounding in how Alan works.
If you haven't already installed the ALAN software, please visit the ALAN website and download and install the the ALAN software for Windows PCs. There are Apple Mac and Linux versions available too.
1. First Introduction to ALAN programming Explains the basic principles of the ALAN programming language. This sample game shows how you can easily create a little interactive textual environment with objects and locations and to define player commands to move around and explore. Read through this example to learn how Alan programming works so you can understand and fully appreciate the features of the Alan standard library introduced in the second example.
- Read the First ALAN Demo sample in colour-highlighted form (or you might want to print this monochrome version if you have a black&white printer)
- Download sgDemo1.alan, the ALAN source-code file which you can compile and play with ALAN V3 software on your own computer.
2. Using the New ALAN Library The sample game becomes both simpler to write and immediately more sophisticated. Because instead of writing each and every little part of the game yourself, you're benefiting from hundreds of lines of code written for you that provide standard player commands, object types ("classes") and many other features that are part of the ALAN standard library.
contact me (my email address is stevgrif (at actrix.co.nz) if you
have any comments, corrections or suggestions. Thank you.)