usually an adventure game has rooms, objects, and the player. i started generalizing it a little so everything was a Thing: class Thing: def __init__(self, name, descr, where=None, **connections): self.name = name self.descr = descr self.where = where self.contents = [] if where is not None: self.where.contents.append(self) self.connections = connections sadly this excessive generality makes it seem more ai-like :/ the intent was to make it concise and simple kinda i'm kind of confused maybe i'll make the player an object, and have rooms separate. that's less ai-like. i dunno i like Thing :s but it makes it last less long :( blrrrgh ok now i'm compromising and making Room a subclass of Thing that has exits :s :s stil lmakes it not last as long :s thinking a little on exits vs connections, i suppose a generalization there is how things can be moved along other things for example, you can climb a tree, but the tree doesn't need to be a room to its own. it's a connection between the top of the tree and the bottom. and only som ethings can climb that connection. other things can also travel it, like water or sap flowing along it. dunno. another idea for exits, connections is maybe more useful: one could represent the relative location of things. then you could put a box on a stone, or on some grass, etc ... this sounds like what exits should be ;-) maybe too ai-like for now though 2124 ok i tried to make a supersimple adventure to demonstrate what adventures are like basically traditionally they have verbs and a bunch of hardcoded engine behaviors that respond to them (amidst a graph of rooms and objects and such) the more one implements old computational linguistics the smarter it gets this is how text adventures used to look and function, very simplistically dumbed down. the attached code creates a super simple one with two rooms, a "simple room", and a "bland room". the user starts in the simple room, whereas the bland room contains an object. You are in the simple room. What do you do?
look
You are in a simple, nondescript room. The bland room is to the east. What do you do?
east
You go east to the bland room. What do you do?
look
You are in a basic, bland room. There is an object here. The simple room is to the west. What do you do?
examine object
It is a basic simple object. What do you do?
take object
You pick up the object. What do you do?
inventory
You are carrying an object. What do you do?
west
You go west to the simple room. What do you do?
drop object
You drop the object. What do you do?
look
You are in a simple, nondescript room. There is an object here. The bland room is to the east. What do you do?
quit