-
Notifications
You must be signed in to change notification settings - Fork 9
Companion Down Mode
Maxwell Schroder edited this page Oct 19, 2023
·
1 revision
The companion down mode is added inside of the companion modes
-
Package:
com.csse3200.game.components.Companion.CompanionActions
-
Inherits From:
Component
Companion down mode is a state of MODE where the companion keyboard is no longer active, it is not animated, and only a selective number of powerups can be used. This is to add value to the companion in its overall game use.
-
String COMPANION_MODE_DOWN
: The string storing the down mode
-
handleCompanionDownMode()
: Handles all the parts of the companion going down// Set animation of companion to be facing down entity.getComponent(CompanionAnimationController.class).animateDown(); // Set the mode to be in down mode setCompanionMode(COMPANION_MODE_DOWN); // Send updated mode to the UI entity.getEvents().trigger("companionModeChange","Down"); // set follow speed to zero entity.getComponent(FollowComponent.class).setFollowSpeed(0f); //OPTIONAL _ MUST IMPLEMENT: trigger death animation entity.getEvents().trigger("companionDeath"); entity.getEvents().trigger("standUp");
In KeyboardCompanionInputComponent.class
You cannot press down (and subsequently make any companion specific actions) if you are in down mode
@Override
public boolean keyDown(int keycode) {
// check if the companion is in down mode
if (!Objects.equals(entity.getComponent(CompanionActions.class).getCompanionMode(), "COMPANION_MODE_DOWN")) {
...
Escape Earth Game
Interaction Controller and Interactable Components
Game and Entity Configuration Files
Loading Game Configuration Files