You need to build a structure with several branched tree types (not a simple binary tree). Nodes are places in the game. Each node can contain several pointers to simple objects / objects (depending on your programming language). When a player moves around the game, you move the pointer to your playerโs position on the node tree representing the location. When you start the game, this tree-like structure is filled with things to pick up, monsters, etc. Random seed can also be used to scatter monsters around.
This helps the speed of the game, since you need to search for the current node and nodes one step from your current location / node. Any routines start the monsters moving forward or back, just moving the monster pointer to the next node or nodes. If a copper package is used, its pointer is destroyed from the room / node in which it is located.
Good luck.
kingchris Jul 12 '09 at 17:08 2009-07-12 17:08
source share