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.
PropertiesName | Type | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
DIRECTIONS | Object | An object containing constants for each direction.Properties
|
- Source
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:
Name | Type | Description |
---|---|---|
direction | string | The direction to find the opposite for. |
- Source
Returns:
- The opposite direction or null if the input is invalid.
- Type:
- string