This module exports constants and functions related to movement directions in the game. It defines the possible directions and provides a function to get the opposite direction.
Properties
NameTypeDescription
DIRECTIONSObjectAn object containing constants for each direction.
Properties
NameTypeDescription
NONEstringRepresents no direction.
UPstringRepresents the upward direction.
DOWNstringRepresents the downward direction.
LEFTstringRepresents the leftward direction.
RIGHTstringRepresents the rightward direction.

Methods

(static) oppositeDirection(direction) → {string}

This function checks the input direction and returns its opposite. If the input is not a valid direction, it returns null.
Parameters:
NameTypeDescription
directionstringThe direction to find the opposite for.
Returns:
- The opposite direction or null if the input is invalid.
Type: 
string