Note: This is an automatic translation from Russian. It looks good enough, but there may be inaccuracies. We are sorry for the inconvenience.
After following the steps in of the previous article , you can already build and run the project. In Visual Studio, just press F5 or Ctrl + F5.
The game interface is standard for interactive literature. The window is divided into four panels: location panel, inventory panel, action panel, and an additional panel. At the top is the menu.
The main action of the game unfolds on the location panel. It describes the location itself, characters, objects, etc.
The Inventory Panel, as the name suggests, displays the items a player has in their inventory. However, it can serve other purposes as well, such as displaying the game menu.
The action panel displays options, in fact, actions that the player can choose at a given location or in a given situation, or options for dialogue with other characters.
An additional panel serves to display auxiliary information that may be relevant at the given game moment.
Each panel, except for the location panel, can be hidden or shown again. This can be done either by the player himself or programmatically.
At the top of the window there is a menu through which you can save and load a game, manage panels and sound volume. The menu can also be hidden through the settings file, or by pressing the F10 key.
After you start the game for the first time, the config.cfg file will appear in the executable file folder (in a Visual Studio project, usually under the path your_project\bin). Using it, you can adjust some of the initial game parameters, for example, launch the application in full screen mode, hide the menu and scroll bars. Open the file with notepad and change the required values. Do not damage the file structure, it may lead to errors. If the game does not start after changing the file, simply delete config.cfg. After the next launch, it will be recreated.
There is also a style.css file in the project folder. Using it, you can change the appearance of the game panels themselves by editing the CSS rules.
To localize the interface to your language, you can use files with the .loc extension, which are also located in the project folder.
The content of each game panel is represented by an HTML document, so you can use HTML markup to decorate text and insert images. However, remember that this is primarily a text game, and you should not use only images, for example, to display objects or actions. Sign interactive game elements with text because your game can be played by visually impaired people using screen readers. Items represented solely by images are not available for such programs.
The game interface supports a number of hotkeys, which will be useful, including, and users of screen readers.
- Ctrl+Q - focus on the location panel.
- Ctrl+W - focus on action panel.
- Ctrl+E - focus on the inventory panel.
- Ctrl+R - focus on additional panel.
- Ctrl+1 - show / hide the inventory panel.
- Ctrl+2 - show / hide action panel.
- Ctrl+3 - show / hide additional panel.
- F10 - show / hide the top menu.
- Ctrl+S - save game.
- Ctrl+O - load game.