-
Notifications
You must be signed in to change notification settings - Fork 0
Implementation
This page explains the implementation of the guidebook. This means the creation of the new java classes that implement the page and link the buttons to other pages. The layout of the page and the importing of data.
New classes were made to implement the guidebook's new page. Classes that were added were GuidebookActions, GuidebookDisplay, GuidebookScreen and GuidebookExit.
The connection between these classes can be seen in the UML below.
These new classes are called with a click of the guidebook button on the main screen. This is implemented through event handlers.
A JSON file was created to fill the content of the Guidebook. We chose a JSON file type because it has an easy maintainability feature; if we want to add new things to the Guidebook, we can easily add the contents here without having to change the code that has been written. We separated the JSON into three parts.
"Page": {
"header": "Header",
"body": "Content"
},
The Page section symbolizes the page on which the desired content would be displayed. The Header corresponds to the topics that are covered specifically by the respective section. Then, the content of the section which includes the tutorial, manual, etc. will be put in the Body section. Below is a glimpse of the JSON file for the Guidebook. Please click this link to see the full JSON file.
{
"Guidebook": {
"tableOfContents": {
"header": "Table of Contents",
"body": "Page 1 - How to Play\n Page 2 - Crystal\n Page 3 - Main Character\n Page 4 - Day and Night Cycles\n Page 5 - Enemies\n Page 6 - Types of Buildings\n Page 7 - Resource Buildings\n Page 8 – Currency\n Page 9 – Shop\n Page 10 – Inventory\n Page 11 - Achievements"
},
"pageOne": {
"header": "How to Play",
"body": "Protect the crystal from the sea enemies by using your character to source materials and currency to create weaponry and buildings that attack and defend. Use the day to build up your defences and prepare for the havoc of the night.\n The game is won when all 4-night cycles, which includes the big boss level, are beaten.\n The game is lost when the crystal has lost all health."
},
...