Moral Decision Display - UQcsse3200/2024-studio-3 GitHub Wiki

Moral System by Team 8

Description

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.

MoralDayX

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.

Key Features

  1. 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.
  2. Customizable Scene Text: The class allows for customizable dialogue through sceneText, which provides the Mafia Boss's dialogue and instructions for player input.
  3. 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.
  4. 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.
  5. 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.

Fields

  • 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.

Constructor

  • MoralDay1Cutscene(): Initializes the cutscene by calling the parent constructor from the Cutscene class and preparing the scenes to be shown.

Methods

  • 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.

MoralDayOne & MoralDayOne with yes/no

Screenshot 2024-10-17 at 1 44 35 am Screenshot 2024-10-17 at 1 44 54 am

MoralDayTwo & MoralDayTwo with yes/no

Screenshot 2024-10-17 at 1 46 07 am Screenshot 2024-10-17 at 1 46 23 am

MoralDayThree & MoralDayThree with yes/no

Screenshot 2024-10-17 at 1 47 21 am Screenshot 2024-10-17 at 1 47 36 am

MoralDayFour & MoralDayFour with yes/no

Screenshot 2024-10-17 at 1 48 31 am Screenshot 2024-10-17 at 1 49 03 am

UML

UML diagram of MoralDayOne

image

UML diagram of MoralDayTwo (follows same structure of MoralDayOne)

image

UML diagram of MoralDayThree (follows same structure of MoralDayOne)

image

UML diagram of MoralDayFour (follows same structure of MoralDayOne)

image

Sequence Diagram of the general MoralDayX sequence

moralsequence

⚠️ **GitHub.com Fallback** ⚠️