The Landusia game has four objects: bandage, sword, flute and rope. These properties are stored in another matrix. The location of the object can either be a room or the player (room zero). Each object can have its own properties, such as weight, and location. A text adventure can also have movable objects. These objects are fixed in that their description is hard-coded into the game. The descriptions of the different rooms of the game can contain objects. Secret of Landusia map (click to enlarge). The connection between room 14 and 15 opens after the player uses the rope in room 14. Clovar’s castle lies to the south-east and the temple north-east of the forest. The blacksmith lives south of the forest. In Landusia, the first nine rooms are a forest. These commands are the four cardinal compass directions, and up and down. The player can move around the map by issuing directional commands. A rockfall could close an entrance, and so on. Specific directions can, for example, only become available after the player opens a door. The map can also dynamically change during the game. The map is stored in a matrix which indicates the relationships between the rooms. The room variable keeps track of where the player is located. The Landusia game, the player has a level of health and maximum carrying capacity. A player can, for example, only carry a certain number of objects, can only endure two blows by a sword, and so on. The program simulates the player with a set of parameters, such as their location, level of health and whatever other aspect is relevant. This function is a separate verb in most adventure games, but in this game, it is integrated with other verbs. The inventory function lists all objects that the player carries. The prose function reads keywords after double hashtags. Using a markdown file simplifies writing the text so it is not hidden amongst code. The prose function describes rooms, actions, actors and so on. The following lines of code print the text up to the next heading indicator. The prose function takes a key phrase and finds the location of the heading for that key in the actions variable. The initialisation includes two auxiliary functions that the player cannot call directly. The code reads the map, objects and prose into memory and sets the starting variables for the player. The initialisation defines the vocabulary through a vector of verbs and a vector of directions.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |