Text Adventure Begun (well nearley)

Blitz3D Forums/Blitz3D Beginners Area/Text Adventure Begun (well nearley)

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Here's how I might set it up:
Type Room
  Field ID%, Name$, Desc$
  Field North.Room, South.Room, East.Room, West.Room
  Field Item[MAX_ITEMS_IN_ROOM] ; Can contain a certain number of items
End Type

Type Player
  Field Name%, Strength%, Intelligence%
  Field Inventory.Item[NUM_ITEMS_IN_GAME]
End Type

Type Item
  Field ID% ; To be indexed on Player\Inventory
  Field Name$, Desc$
  Field Location.Room
  Field UsedWith.Item[3] ; Can be used with a few other items
End Type


Now to check if a certain item can be used with another, you might do something like this:
ItemUsed.Item = Player\Inventory[ItemID]
ItemUsedOn.Item = Room\Item[2]
If ItemUsed\UsedWith[1] = ItemUsedOn Then Print "Yes, this item can be used with that item."

This is just to give you some ideas. It might not be the best way.