-
Notifications
You must be signed in to change notification settings - Fork 3
Touch Components
Entities need to interact once they are within proximity of each other. Currently the only way this occurs is once an attack between two entities occurs but does not cover triggers for events to occur or collection of items.
TouchAttackComponent
class is a part of the base engine but has been changed to extend TouchComponent
which is a base class for any Touch interactions.
This component needs a subclass to extend it and provide the functionality for the collisions. The collisions that take place are reliant on the hitboxes of those entities and the onCollisionStart
needs to be implemented. onCollisionStart
will take in the entities that are in the collision and this method is where any changes due to collision will be called.
The onCollisionStart
method will require some error checking before any functionality is carried out to ensure that the entities that are involved with the collision are correct.
The sequence diagram below shows the event when the player entity collides a Cutscene and Movement trigger entity. The main steps of this sequence are:
- The entities in the collision are verified to see if the collision is valid.
- If the entities are valid, movement and input from the player will pause and a text box will be displayed.
- While the player is moving, there will be repeated checks (loop) to determine if the player has reached the desired destinations.
- The inputcomponent will no longer be locked and will now accept input.
This is an abstract class that has been made for the basis of all functionality regarding entity interaction.
The TouchComponent class contains the protected variables:
-
targetLayer
: the group of entities the owner of the component can interact with -
hitboxComponent
: the component of the hitbox of the owner entity
The TouchComponent class contains these methods:
- Constructor
TouchComponent(short targetLayer)
: takes in a targetLayer, which is the group of entities that the owner of this entity can interact with. -
create()
: adds the event listener to the entity which will callonCollisionStart()
, an abstract method that will be in the classes that extend TouchComponent as well as the hitbox of that entity.
This component will be added to any entity that can target and damage another entity. Along with the base requirements, the component will need the knockback force as well as the CombatStatsComponent
to determine how much damage the collision will do to either player.
The onCollisionStart
method will attempt to attack the target by altering the health of the entity within the collision, then it will apply the knockback on the entity.
This component will be used to trigger any cutscenes within the game once the player has interacted with the entity. The entity that triggers the cutscene could be both a visible entity in the game or an invisible hook once the player walks within a certain vicinity.
This component will access the dialogue component within the UI and set the dialogue to whatever message is to be displayed. Since the character will usually trigger this by walking, the player will stop moving or potentially by involuntarily moved once triggered since the dialogue boxes have higher priority input.
This component is used to move the player in any direction after triggering it until a certain position has been passed. This component can be used in addition to the TouchCutsceneComponent
allowing for the text box to appear as well as control the character simultaneously.
Chaining of entity triggers containing TouchMoveComponent
allow the game to control the player through a complicated set of movements. Skipping cutscenes has been considered but teleporting the player to the final position can cause issues with the stuttering of the camera.
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