MUD
Back before there were real video games, people used to lose hour upon hour playing text based role playing games called MUDs. The basic jist of the games were that you were in some map partitioned into square blocks. From that block you could travel up, down, left, or right into an adjacent block. Sometimes you would run into a wall or find a fiendish dragon or worse in the adjacent cell; at which point you would make the exciting decision of whether to run from or fight with your foe.
A good way of representing the map of the MUD would be to use cell( or block ) objects which contain pointers to their adjacent cells. A wall could be represented by a NULL pointer. The map can be created by declaring a handful of cells which are connected by their pointers.
In the folder MUD write the cell class. Then write a main program which creates a map and lets the user wander around it. Once you have the basic functionality, start adding features. Perhaps each cell can contain either nothing, treasure, or a bottomless pit into which the player falls ( causing the end of the game ).
Back before there were real video games, people used to lose hour upon hour playing text based role playing games called MUDs. The basic jist of the games were that you were in some map partitioned into square blocks. From that block you could travel up, down, left, or right into an adjacent block. Sometimes you would run into a wall or find a fiendish dragon or worse in the adjacent cell; at which point you would make the exciting decision of whether to run from or fight with your foe.
A good way of representing the map of the MUD would be to use cell( or block ) objects which contain pointers to their adjacent cells. A wall could be represented by a NULL pointer. The map can be created by declaring a handful of cells which are connected by their pointers.
In the folder MUD write the cell class. Then write a main program which creates a map and lets the user wander around it. Once you have the basic functionality, start adding features. Perhaps each cell can contain either nothing, treasure, or a bottomless pit into which the player falls ( causing the end of the game ).
Comment