Overview

Create a simple door object which can be used as a base door to create various doors for a game, for instance, automatic or interactive ones.

The object should have these parameters, functions, and callbacks.

PARAMETER DESCRIPTION
InitialState Determines the current state of the door at the beginning of a game
CurrentState Determines the current state of the door
AnimationDuration Duration of the animation in seconds
FUNCTION DESCRIPTION
OpenDoor Initiates a door opening sequence
CloseDoor Initiates a door closing sequence
CALLBACK DESCRIPTION
OnDoorStateChanged Called when the current door state changes

Challenges

  1. Use a Flexible Keys system to implement:
    1. Locked state
    2. Lock function, which locks a door. It should have an option to ignore a required key
    3. Unlock function, which locks a door. It should have an option to ignore a required key
  2. Implement reverse behavior for a door. For instance, if the door is opening and the player tries to close it, the door will reverse and start to close
  3. Create a new type of door AutomaticDoor, this door type opens and closes automatically if the player enters and exits an activation trigger