-
Notifications
You must be signed in to change notification settings - Fork 3
Cutscene Implementation
The Text Box is stored in the game as a UI component that is retrievable with the use of ServiceLocators, Entities, UI. A global access of the Text Box has been decided since the text box can be triggered in many locations - game start, enemy kill, map positions, etc. There is also a single text box UI component which will be constantly changed instead of instantiating a new one when it needs to be displayed.
Depending on the game area, a text box will appear on game start to introduce the location, enemies and storyline. The opening of the text box will be triggered by the method setRandomFirstEncounter(RandomDialogueSet)
when the game spawns all of the entities that populate the map. This method call will open the text box to be displayed as well as change it to the correct set of messages.
RandomDialogueSet is an enum containing sets of messages that relate to specific NPCs within the game. For more: RandomDialogueSet
The triggers that involve cutscenes will be spawned at specific locations in the GameArea
as well. These triggers are all within the CutsceneTriggerFactory
class and can control the player to walk, attack and open cutscenes. Each trigger is an entity that takes the components from TouchComponent
and multiple components can be added to one entity. The types of triggers will depend on the NPC the trigger will take the form of, and the type of movement or action required.
To find out more about CutsceneTriggerFactory
: Cutscene Trigger Factory
To add a cutscene trigger to the game, it needs to be done in the GameArea
of the desired map. Each entity will need to be placed at specific positions in the map and this will usually require some testing for the X and Y positions.
The types of cutscenes and their method calls are shown below:
To create the dialogue trigger, the entity will require the parameters:
-
RandomDialogueSet: randomDialogueSet
: a set of dialogue chosen from RandomDialogueSet enum -
DialogueSet: dialogueSet
: the type of selection chosen from DialogueSet
This entity will cause the text box to open when the player has collided with the entity.
To create the dialogue trigger in the form of a Loki NPC, the entity will require the parameters:
-
RandomDialogueSet: randomDialogueSet
: a set of dialogue chosen from RandomDialogueSet enum -
DialogueSet: dialogueSet
: the type of selection chosen from DialogueSet
This entity will cause the text box to open when the player has collided with the entity.
To create the dialogue trigger, the entity will require the parameters:
-
int: repeats
: the number of attacks the player will perform -
int: lastKeyPressed
: the direction in the form of a letter (W, A, S, D) of the attack
This entity will cause the player to attack a repeated amount of times in the direction specified.
To create the dialogue trigger, the entity will require the parameters:
-
Vector2: direction
: the number of attacks the player will perform -
int: x
: the maximum direction the player will walk in the x direction -
int: y
: the minimum direction the player will walk in the y direction
This entity will cause the player to move in the direction specified when the player has collided with the entity.
Here is an example entity spawn of a Dialogue Trigger in the form of a Prisoner and a Dialogue Trigger in the form of Loki.
Each of the Dialogue Triggers require the set RandomDialogueSet.TUTORIAL
and RandomDialogueSet.LOKI_OPENING
. The types of dialogue selection is also passed in as DialogueSet.ORDERED
and DialogueSet.BOSS_DEFEATED_BEFORE
.
Entity trigger = CutsceneTriggerFactory.createDialogueTrigger(RandomDialogueSet.TUTORIAL,
DialogueSet.ORDERED);
spawnEntityAt(trigger, TEST_TRIGGER, true, true);
Entity trigger3 = CutsceneTriggerFactory.createLokiTrigger(RandomDialogueSet.LOKI_OPENING,
DialogueSet.BOSS_DEFEATED_BEFORE);
spawnEntityAt(trigger3, new Vector2(7f, 9.5f), true, true);
Design Document
- Story
- Music
-
Characters
- Main Character
- Bosses
-
Enemies
- Sprint 1: Final Design
-
Sprint 2: Elvish Boss
- Decision to make our boss a mage
- Design Inspiration: Staff Weapon
- Design decisions for boss
- Archery attack animation for minions
- Different types of minion elves and designs
- Melee attack animation
- Boss attack animation using sceptre
- Design Inspiration: Shooting fireballs
- Mage Boss attack method: fireball
- Sprint 3: Walk Animations and Design Amendments
- Sprint 4: Refining animations
- Map Design
- User + Play Testing
- Gameplay
- Art Style Design Guidelines
- Emotional Goals