Moral Decision Display - UQcsse3200/2024-studio-3 GitHub Wiki
Moral System by Team 8
In the updated moral system, players must make decisions that affect the next day as well as the game's ending. On screen, the Rhino Mafia Boss will present the player with a moral dilemma. See the Storyline wiki for all moral dilemmas here.
For each moral decision (total 4), a different screen is created for each one. These classes have the same core code, but changes in background image to represent the choice being given to the player, as well as character dialogue. The classes are named MoralDay1Cutscene, MoralDay2Cutscene, MoralDay3Cutscene, MoralDay4Cutscene - and hence will be referred to as MoralDayX.
- Scene Setup: The class creates two key scenes, which introduce the moral dilemma and the player's decision. Each scene displays specific background images, characters, and dialogue related to the story.
-
Customizable Scene Text: The class allows for customizable dialogue through
sceneText
, which provides the Mafia Boss's dialogue and instructions for player input. - Multiple Visual Elements: Scenes feature various images, such as the Mafia Boss character, decision icons (yes/no), and thematic icons representing the dilemma (e.g., laundering money). Each image has a defined position and scale for proper in-game display.
-
Asset Management: The class efficiently manages the loading and display of textures, including background images, character artwork, and icons, via the
ResourceService
. The assets are preloaded to ensure smooth cutscene transitions. - Modular Design: The class structure is modular, making it easy to adapt the cutscene for future days (e.g., MoralDay2, MoralDay3) with minimal changes in dialogue and image paths, while maintaining the core logic.
-
textures (String[])
: Stores file paths to the background images used in the cutscene. -
animations (String[])
: Placeholder for animations, if required in future scenes. -
images (String[])
: Stores file paths for character sprites, moral icons, and decision icons. -
scenes (Array<Scene>)
: Contains the individual scenes that make up the cutscene, each with its own dialogue and visual elements.
-
MoralDay1Cutscene()
: Initializes the cutscene by calling the parent constructor from theCutscene
class and preparing the scenes to be shown.
-
setupScenes()
: This method sets up the two main scenes (createScene and createScene2), each with its own set of dialogue and visual elements. -
createScene()
: The first scene presents the player with dialogue from the Mafia Boss about laundering money, setting up the moral dilemma. It also displays the Mafia Boss character and thematic icons. -
createScene2()
: The second scene gives the player instructions to press "yes" or "no" to make their decision. It displays decision icons (yes/no) and the Mafia Boss character. -
loadAssets()
: Preloads the necessary textures (backgrounds, character sprites, and icons) using the ResourceService to ensure the assets are ready before the cutscene begins. -
createEntities()
: Placeholder method for creating specific entities related to the cutscene, if needed in future expansions of the game.
UML diagram of MoralDayOne
UML diagram of MoralDayTwo (follows same structure of MoralDayOne)
UML diagram of MoralDayThree (follows same structure of MoralDayOne)
UML diagram of MoralDayFour (follows same structure of MoralDayOne)
Sequence Diagram of the general MoralDayX sequence