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
- Use a Flexible Keys system to implement:
Locked
state
Lock
function, which locks a door. It should have an option to ignore a required key
Unlock
function, which locks a door. It should have an option to ignore a required key
- 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
- Create a new type of door
AutomaticDoor
, this door type opens and closes automatically if the player enters and exits an activation trigger