November 2010
Intermediate to advanced
504 pages
12h 45m
English
To create the final piece of code to help us visualize our game world, we need to describe the objects on the floor at a given location, which a player can pick up and use.
To do so, we first create a list of the objects:
> (defparameter *objects* '(whiskey bucket frog chain))
*OBJECTS*
We can also create a second variable, *object-locations*, to track the location of each object in the form of an alist:
(defparameter *object-locations* '((whiskey living-room)
(bucket living-room)
(chain garden)
(frog garden)))Next, we write a function that lists the objects visible from a given location: ...
Read now
Unlock full access