Skip to content

Implementation

baguspr edited this page Oct 2, 2022 · 14 revisions

Description

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.

Classes

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.

JSON

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."
    },
...

Annimation

Table of Contents

Home

How to Play

Introduction

Game Features

Main Character

Enemies
The Final Boss

Landscape Objects

Shop
Inventory
Achievements
Camera

Crystal

Infrastructure

Audio

User Interfaces Across All Pages
Juicy UI
User Interfaces Buildings
Guidebook
[Resource Management](Resource-Management)
Map
Day and Night Cycle
Unified Grid System (UGS)
Polishing

Game Engine

Getting Started

Entities and Components

Service Locator

Loading Resources

Logging

Unit Testing

Debug Terminal

Input Handling

UI

Animations

Audio

AI

Physics

Game Screens and Areas

Terrain

Concurrency & Threading

Settings

Troubleshooting

MacOS Setup Guide

Clone this wiki locally